From fbcd9d67eae182bd3f232822efcbcd44e989419f Mon Sep 17 00:00:00 2001 From: Jens Utbult Date: Tue, 26 Nov 2024 09:43:42 +0100 Subject: [PATCH] Fix bug where a cancellation error would be passed on to a alert when it should be ignored. --- Authenticator/Model/MainViewModel.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Authenticator/Model/MainViewModel.swift b/Authenticator/Model/MainViewModel.swift index d1159b78..6e64ad00 100644 --- a/Authenticator/Model/MainViewModel.swift +++ b/Authenticator/Model/MainViewModel.swift @@ -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 }