updated sheet close when successful added another acoount #4
Build Unsigned iOS ipa / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned macOS App / Build macOS ZIP (push) Canceled after 0s
iOS CI / Build and Test SwiftUI App (push) Canceled after 0s

This commit is contained in:
wt
2026-09-27 23:37:44 +07:00
parent de61940c95
commit 8f235b4ff9
2 changed files with 8 additions and 2 deletions
+8
View File
@@ -2,6 +2,7 @@ import SwiftUI
struct LoginView: View {
@ObservedObject var model: AppModel
@Environment(\.dismiss) private var dismiss
@State private var jid = ""
@State private var password = ""
@State private var passwordVisible = false
@@ -201,6 +202,13 @@ struct LoginView: View {
usesDirectTLS: directTLS
)
await model.signIn(account: account, password: password)
// When LoginView is presented from Settings, close the sheet only
// after AppModel has completed a successful sign-in. On failure the
// model clears the active account, so the form remains available for
// correcting the credentials.
guard model.account?.normalizedJID == account.normalizedJID else { return }
dismiss()
}
}