File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ struct LoginSlide: View {
137137 . background ( . blue. gradient)
138138 . cornerRadius ( 15 )
139139 }
140- . disabled ( isLoggingIn || viewModel . loginViewModel . isLoginInProgress || viewModel. loginViewModel. isVerificationCodeSubmitting)
140+ . disabled ( viewModel. loginViewModel. isVerificationCodeSubmitting)
141141 }
142142 . padding ( )
143143 . background ( Color ( UIColor . secondarySystemGroupedBackground) )
@@ -169,6 +169,7 @@ struct LoginSlide: View {
169169 if viewModel. loginViewModel. needVerificationCode {
170170 try await viewModel. loginViewModel. verifyTwoFactorCode ( verificationCode)
171171 await MainActor . run {
172+ isLoggingIn = false
172173 viewModel. nextStep ( )
173174 }
174175 return
@@ -203,6 +204,11 @@ struct LoginSlide: View {
203204 if !viewModel. loginViewModel. needVerificationCode {
204205 viewModel. errorMessage = error. localizedDescription
205206 viewModel. showError = true
207+ } else {
208+ // When 2FA is needed, ensure isLoginInProgress is false so the verify button works
209+ viewModel. loginViewModel. isLoginInProgress = false
210+ // Force UI refresh by toggling isLoggingIn
211+ isLoggingIn = false
206212 }
207213 isLoggingIn = false
208214 }
You can’t perform that action at this time.
0 commit comments