Initial implementation for AppLockSetupFlowCoordinator. (#1949)

Rename AppLockSettingsScreen to AppLockSetupSettingsScreen.
Implement forced logout and persist PIN entry attempts.
This commit is contained in:
Doug
2023-10-25 12:03:37 +01:00
committed by GitHub
parent 30b18031a0
commit c6e4dc2a37
53 changed files with 773 additions and 234 deletions
@@ -19,6 +19,8 @@ import Foundation
enum AppLockScreenViewModelAction {
/// The user has successfully unlocked the app.
case appUnlocked
/// The user failed to unlock the app (or forgot their PIN).
case forceLogout
}
struct AppLockScreenViewState: BindableState {
@@ -36,7 +38,7 @@ struct AppLockScreenViewState: BindableState {
/// The string shown in the screen's subtitle.
var subtitle: String {
if !isSubtitleWarning {
return L10n.screenAppLockSubtitle
return L10n.screenAppLockSubtitle(maximumAttempts)
} else {
return L10n.screenAppLockSubtitleWrongPin(maximumAttempts - numberOfPINAttempts)
}
@@ -50,8 +52,8 @@ struct AppLockScreenViewStateBindings {
}
enum AppLockScreenAlertType {
/// The user has failed too many times, they're being signed out.
case forceSignOut
/// The user has failed too many times, they're being logged out.
case forcedLogout
/// The user has forgotten their PIN, confirm they're happy to sign out.
case confirmResetPIN
}