Update Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewModel.swift

Co-authored-by: SBiOSoftWhare <SBiOSoftWhare@users.noreply.github.com>
This commit is contained in:
Gil Eluard
2021-01-08 14:46:30 +01:00
committed by GitHub
parent 82fd55152e
commit d56fabad58

View File

@@ -227,16 +227,13 @@ final class EnterPinCodeViewModel: EnterPinCodeViewModelType {
firstPin = currentPin
currentPin.removeAll()
update(viewState: .confirmPin)
} else {
// check first and second pins
if firstPin == currentPin {
} else if firstPin == currentPin { // check first and second pins
// complete with a little delay
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.coordinatorDelegate?.enterPinCodeViewModel(self, didCompleteWithPin: self.firstPin)
}
} else {
} else {
update(viewState: .pinsDontMatch)
}
}
}
}