mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
Fix error conversion
This commit is contained in:
@@ -99,10 +99,10 @@ extension KeychainStore: KeyValueStore {
|
||||
}
|
||||
|
||||
func integer(forKey key: KeyValueStoreKey) throws -> Int? {
|
||||
guard let stringValue = keychain.getString(key) else {
|
||||
return nil
|
||||
}
|
||||
return try Int(stringValue)
|
||||
guard let stringValue = try keychain.getString(key) else {
|
||||
return nil
|
||||
}
|
||||
return Int(stringValue)
|
||||
}
|
||||
|
||||
// remove
|
||||
|
||||
@@ -104,19 +104,20 @@ final class SetupBiometricsViewModel: SetupBiometricsViewModelType {
|
||||
LocalAuthenticationService.isShowingBiometrics = false
|
||||
}
|
||||
} else {
|
||||
if let error = error as NSError? {
|
||||
self.pinCodePreferences.numberOfBiometricsFailures += 1
|
||||
if self.localAuthenticationService.shouldLogOutUser() {
|
||||
// biometrics can't be used until further unlock with pin or a new log in
|
||||
self.pinCodePreferences.canUseBiometricsToUnlock = false
|
||||
DispatchQueue.main.async {
|
||||
self.coordinatorDelegate?.setupBiometricsViewModelDidCompleteWithReset(self, dueToTooManyErrors: true)
|
||||
LocalAuthenticationService.isShowingBiometrics = false
|
||||
}
|
||||
} else if error.code == LAError.Code.userCancel.rawValue || error.code == LAError.Code.userFallback.rawValue {
|
||||
self.userCancelledUnlockWithBiometrics()
|
||||
guard let error = error as NSError? else {
|
||||
return
|
||||
}
|
||||
self.pinCodePreferences.numberOfBiometricsFailures += 1
|
||||
if self.localAuthenticationService.shouldLogOutUser() {
|
||||
// biometrics can't be used until further unlock with pin or a new log in
|
||||
self.pinCodePreferences.canUseBiometricsToUnlock = false
|
||||
DispatchQueue.main.async {
|
||||
self.coordinatorDelegate?.setupBiometricsViewModelDidCompleteWithReset(self, dueToTooManyErrors: true)
|
||||
LocalAuthenticationService.isShowingBiometrics = false
|
||||
}
|
||||
} else if error.code == LAError.Code.userCancel.rawValue || error.code == LAError.Code.userFallback.rawValue {
|
||||
self.userCancelledUnlockWithBiometrics()
|
||||
LocalAuthenticationService.isShowingBiometrics = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user