Skip to content

Commit 9205bdd

Browse files
committed
Fix frozen UI when 2FA
1 parent 7587efd commit 9205bdd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

iRAM-Plus/WizardViews.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)