updated sheet close when successful added another acoount #4
This commit is contained in:
1 parent
de61940c95
commit
8f235b4ff9
2 files changed
+8
-2
No files matched your search
@@ -1765,7 +1765,6 @@
|
|||||||
};
|
};
|
||||||
371134B6F3E284082E28FE08 /* MartinOMEMO */ = {
|
371134B6F3E284082E28FE08 /* MartinOMEMO */ = {
|
||||||
isa = XCSwiftPackageProductDependency;
|
isa = XCSwiftPackageProductDependency;
|
||||||
package = 3B2A3CB97916A28030D0A4E0 /* XCLocalSwiftPackageReference "ThirdParty/MartinOMEMO" */;
|
|
||||||
productName = MartinOMEMO;
|
productName = MartinOMEMO;
|
||||||
};
|
};
|
||||||
4BD4324EE01A6DD46EBE7FDA /* Martin */ = {
|
4BD4324EE01A6DD46EBE7FDA /* Martin */ = {
|
||||||
@@ -1780,7 +1779,6 @@
|
|||||||
};
|
};
|
||||||
7A670E49149C9C7E13F0A6A2 /* MartinOMEMO */ = {
|
7A670E49149C9C7E13F0A6A2 /* MartinOMEMO */ = {
|
||||||
isa = XCSwiftPackageProductDependency;
|
isa = XCSwiftPackageProductDependency;
|
||||||
package = 3B2A3CB97916A28030D0A4E0 /* XCLocalSwiftPackageReference "ThirdParty/MartinOMEMO" */;
|
|
||||||
productName = MartinOMEMO;
|
productName = MartinOMEMO;
|
||||||
};
|
};
|
||||||
A99B4C1B1459E1C34F214164 /* OpenSSL */ = {
|
A99B4C1B1459E1C34F214164 /* OpenSSL */ = {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import SwiftUI
|
|||||||
|
|
||||||
struct LoginView: View {
|
struct LoginView: View {
|
||||||
@ObservedObject var model: AppModel
|
@ObservedObject var model: AppModel
|
||||||
|
@Environment(\.dismiss) private var dismiss
|
||||||
@State private var jid = ""
|
@State private var jid = ""
|
||||||
@State private var password = ""
|
@State private var password = ""
|
||||||
@State private var passwordVisible = false
|
@State private var passwordVisible = false
|
||||||
@@ -201,6 +202,13 @@ struct LoginView: View {
|
|||||||
usesDirectTLS: directTLS
|
usesDirectTLS: directTLS
|
||||||
)
|
)
|
||||||
await model.signIn(account: account, password: password)
|
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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user