Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: fix vault asks for fingerprint permission on creating vault

Ammar Ahmed1d292d740c33
diff --git a/apps/mobile/app/components/dialogs/vault/index.tsx b/apps/mobile/app/components/dialogs/vault/index.tsx
index d7d096087..3a7c1e53a 100644
--- a/apps/mobile/app/components/dialogs/vault/index.tsx
+++ b/apps/mobile/app/components/dialogs/vault/index.tsx
@@ -641,16 +641,22 @@ export const VaultDialog: React.FC = () => {
// Auto-unlock with fingerprint if applicable
const canAutoUnlock =
fingerprint &&
+ available &&
data.requestType !== VaultRequestType.EnableFingerprint &&
data.requestType !== VaultRequestType.RevokeFingerprint &&
data.requestType !== VaultRequestType.ChangePassword &&
data.requestType !== VaultRequestType.ClearVault &&
data.requestType !== VaultRequestType.DeleteVault &&
data.requestType !== VaultRequestType.CustomAction &&
- data.requestType !== VaultRequestType.PermanentUnlock;
+ data.requestType !== VaultRequestType.PermanentUnlock &&
+ data.requestType !== VaultRequestType.CreateVault;
- if (canAutoUnlock) {
- await onPressFingerprintAuth(data.title, data.description);
+ if (canAutoUnlock && available) {
+ try {
+ await onPressFingerprintAuth(data.title, data.description);
+ } catch (e) {
+ setVisible(true);
+ }
} else {
setVisible(true);
}