mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Handle invalid PIN input in the settings flow. (#1972)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user