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

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,