From a76a27106a71237a29106a771048ec014dfd7cfe Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Tue, 20 Feb 2024 18:10:46 -0400 Subject: [PATCH] FIX: dispatch UI for biometrics was firing regardless --- UnlockWith.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/UnlockWith.tsx b/UnlockWith.tsx index e03169a2b..0c94198fc 100644 --- a/UnlockWith.tsx +++ b/UnlockWith.tsx @@ -132,15 +132,14 @@ const UnlockWith: React.FC = () => { const startUnlock = async () => { if (unlockOnComponentMount) { const storageIsEncrypted = await isStorageEncrypted(); - dispatch({ type: SET_IS_STORAGE_ENCRYPTED_ENABLED, payload: storageIsEncrypted }); - const isBiometricUseCapableAndEnabled = await Biometric.isBiometricUseCapableAndEnabled(); const rawType = isBiometricUseCapableAndEnabled ? await Biometric.biometricType() : undefined; - dispatch({ type: SET_BIOMETRIC_TYPE, payload: rawType }); if (!rawType || storageIsEncrypted) { + dispatch({ type: SET_IS_STORAGE_ENCRYPTED_ENABLED, payload: storageIsEncrypted }); unlockWithKey(); } else { + dispatch({ type: SET_BIOMETRIC_TYPE, payload: rawType }); unlockWithBiometrics(); } }