mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 23:48:29 +02:00
MESSENGER-2762 Initial Merge
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// $ createScreen.sh SetPinCode/EnterPinCode EnterPinCode
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright (c) 2021 BWI GmbH
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -120,14 +121,15 @@ final class EnterPinCodeViewModel: EnterPinCodeViewModelType {
|
||||
updateAfterPinSet()
|
||||
case .unlock, .confirmPinToDeactivate:
|
||||
// unlocking
|
||||
if currentPin != pinCodePreferences.pin {
|
||||
if !pinCodePreferences.pinsMatch(currentPin) {
|
||||
// no match
|
||||
updateAfterUnlockFailed()
|
||||
} else {
|
||||
// match
|
||||
// we can use biometrics anymore, if set
|
||||
pinCodePreferences.canUseBiometricsToUnlock = nil
|
||||
pinCodePreferences.canUseBiometricsToUnlock = true
|
||||
pinCodePreferences.resetCounters()
|
||||
EncryptionKeyManager.shared.initKeys()
|
||||
// complete with a little delay
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
self.coordinatorDelegate?.enterPinCodeViewModelDidComplete(self)
|
||||
@@ -135,7 +137,7 @@ final class EnterPinCodeViewModel: EnterPinCodeViewModelType {
|
||||
}
|
||||
case .changePin:
|
||||
// unlocking
|
||||
if initialPin.isEmpty && currentPin != pinCodePreferences.pin {
|
||||
if initialPin.isEmpty && !pinCodePreferences.pinsMatch(currentPin) {
|
||||
// no match
|
||||
updateAfterUnlockFailed()
|
||||
} else if initialPin.isEmpty {
|
||||
|
||||
Reference in New Issue
Block a user