Fix an empty dialog would appear if the selected language was empty (#873)

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
This commit is contained in:
Yusuke Arakawa 2023-02-15 16:20:45 +09:00 committed by GitHub
parent 4fc00ea447
commit c09543b9de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -145,6 +145,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject {
func evaluateLanguages() {
if let detectedLang = detectLanguage(text: statusText.string),
let selectedLanguage = selectedLanguage,
selectedLanguage != "",
selectedLanguage != detectedLang
{
languageConfirmationDialogLanguages = ["detected": detectedLang,