Skip to content

Commit

Permalink
Fix bug where a cancellation error would be passed on to a alert when…
Browse files Browse the repository at this point in the history
… it should be ignored.
  • Loading branch information
jensutbult committed Nov 26, 2024
1 parent a9a1b3a commit fbcd9d6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Authenticator/Model/MainViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ class MainViewModel: ObservableObject {
}
}
} catch {
// Only handle .otpEnabledError by presenting the disable OTP modal
if let sessionError = error as? OATHSessionError, sessionError == .otpEnabledError {
self?.presentDisableOTP = true
if let sessionError = error as? OATHSessionError {
if sessionError == .otpEnabledError {
self?.presentDisableOTP = true
} else if sessionError != .connectionCancelled {
self?.connectionError = error
}
} else {
self?.connectionError = error
}
Expand Down

0 comments on commit fbcd9d6

Please sign in to comment.