Handle invalid PIN input in the settings flow. (#1972)

This commit is contained in:
Doug
2023-10-27 14:08:06 +01:00
committed by GitHub
parent acfc564490
commit 84a16091b2
19 changed files with 209 additions and 39 deletions
@@ -24,7 +24,8 @@ enum AppLockScreenViewModelAction {
}
struct AppLockScreenViewState: BindableState {
private let maximumAttempts = 3
/// The number of attempts allowed to unlock the app.
let maximumAttempts = 3
/// The number of times the user attempted to enter their PIN.
var numberOfPINAttempts = 0
@@ -78,7 +78,7 @@ class AppLockScreenViewModel: AppLockScreenViewModelType, AppLockScreenViewModel
}
private func showForceLogoutAlertIfNeeded() {
if state.numberOfPINAttempts >= 3 {
if state.numberOfPINAttempts >= state.maximumAttempts {
state.bindings.alertInfo = .init(id: .forcedLogout,
title: L10n.screenAppLockSignoutAlertTitle,
message: L10n.screenAppLockSignoutAlertMessage,