Introduce dueToTooManyErrors parameter

This commit is contained in:
ismailgulek
2020-09-29 17:46:07 +03:00
parent 208c1bb434
commit ef9b200939
12 changed files with 29 additions and 22 deletions

View File

@@ -72,7 +72,7 @@ final class EnterPinCodeViewModel: EnterPinCodeViewModelType {
// go back to first state
self.update(viewState: .choosePin)
case .forgotPinAlertResetAction:
self.coordinatorDelegate?.enterPinCodeViewModelDidCompleteWithReset(self)
self.coordinatorDelegate?.enterPinCodeViewModelDidCompleteWithReset(self, dueToTooManyErrors: false)
case .forgotPinAlertCancelAction:
// no-op
break
@@ -146,7 +146,7 @@ final class EnterPinCodeViewModel: EnterPinCodeViewModelType {
pinCodePreferences.numberOfPinFailures += 1
if viewMode == .unlock && localAuthenticationService.shouldLogOutUser() {
// log out user
self.coordinatorDelegate?.enterPinCodeViewModelDidCompleteWithReset(self)
self.coordinatorDelegate?.enterPinCodeViewModelDidCompleteWithReset(self, dueToTooManyErrors: true)
return
}
if numberOfFailuresDuringEnterPIN < pinCodePreferences.allowedNumberOfTrialsBeforeAlert {