Skip to content

Commit

Permalink
fix: unlocking with face id (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
janrtvld authored Nov 11, 2024
1 parent c942e02 commit 7f41611
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ function _useSecureUnlockState<Context extends Record<string, unknown>>(): Secur
if (!canTryUnlockingUsingBiometrics) return null

setIsUnlocking(true)
setCanTryUnlockingUsingBiometrics(false)
setBiometricsUnlockAttempts((attempts) => attempts + 1)
try {
const walletKey = await secureWalletKey.getWalletKeyUsingBiometrics(secureWalletKey.getWalletKeyVersion())
Expand All @@ -188,8 +187,8 @@ function _useSecureUnlockState<Context extends Record<string, unknown>>(): Secur
setCanTryUnlockingUsingBiometrics(false)
}
// If other error, we will allow up to three attempts
else if (biometricsUnlockAttempts < 3) {
setCanTryUnlockingUsingBiometrics(true)
else if (biometricsUnlockAttempts > 3) {
setCanTryUnlockingUsingBiometrics(false)
}
} finally {
setIsUnlocking(false)
Expand Down

0 comments on commit 7f41611

Please sign in to comment.