mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 15:04:50 +01:00
Merge pull request #6162 from BlueWallet/dispatch
FIX: dispatch UI for biometrics was firing regardless
This commit is contained in:
commit
d3fc52f01c
1 changed files with 2 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue