Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Only do pendingmigrations check in sync if vault is unlocked (#957)

Leendert de Borst6f421bbdc152
diff --git a/apps/mobile-app/hooks/useVaultSync.ts b/apps/mobile-app/hooks/useVaultSync.ts
index 1fc9538d1..419f521fe 100644
--- a/apps/mobile-app/hooks/useVaultSync.ts
+++ b/apps/mobile-app/hooks/useVaultSync.ts
@@ -6,6 +6,7 @@ import type { VaultResponse } from '@/utils/dist/shared/models/webapi';
import { useAuth } from '@/context/AuthContext';
import { useDb } from '@/context/DbContext';
import { useWebApi } from '@/context/WebApiContext';
+import NativeVaultManager from '@/specs/NativeVaultManager';
/**
* Utility function to ensure a minimum time has elapsed for an operation
@@ -129,7 +130,7 @@ export const useVaultSync = () : {
}
// Check if the vault is up to date, if not, redirect to the upgrade page.
- if (await dbContext.hasPendingMigrations()) {
+ if (await NativeVaultManager.isVaultUnlocked() && await dbContext.hasPendingMigrations()) {
onUpgradeRequired?.();
return false;
}