From 6db853c65544a145812a6432f13f27cde20545d7 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 5 Aug 2026 17:54:23 +0530 Subject: [PATCH] fix: resolve 4 bugs in AccountSafe --- frontend/src/components/PanicListener.tsx | 2 +- frontend/src/features/vault/hooks/useExport.ts | 2 +- frontend/src/pages/DashboardPage.tsx | 2 ++ frontend/src/pages/OrganizationPage.tsx | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/PanicListener.tsx b/frontend/src/components/PanicListener.tsx index 80564ea..0e776ab 100644 --- a/frontend/src/components/PanicListener.tsx +++ b/frontend/src/components/PanicListener.tsx @@ -143,7 +143,7 @@ const PanicListener: React.FC = ({ onPanic }) => { if (currentKeys.length !== shortcut.length) return; // Sort and compare - const normalizedPressed = currentKeys.map(k => k.toLowerCase()).sort(); + const normalizedPressed = currentKeys.map(k => k.toLowerCase()).sort((a, b) => a - b); const normalizedShortcut = shortcut.map(k => k.toLowerCase()).sort(); const matches = normalizedPressed.every((key, index) => key === normalizedShortcut[index]); diff --git a/frontend/src/features/vault/hooks/useExport.ts b/frontend/src/features/vault/hooks/useExport.ts index 6c294c0..b998be9 100644 --- a/frontend/src/features/vault/hooks/useExport.ts +++ b/frontend/src/features/vault/hooks/useExport.ts @@ -148,7 +148,7 @@ export function useExport(): UseExportReturn { */ const exportVault = useCallback(async (password: string, format: ExportFormat) => { // Validate inputs - if (!password || password.trim() === '') { + if (!password || password.trim().length === 0) { setError('Password is required'); setPhase('ERROR'); return; diff --git a/frontend/src/pages/DashboardPage.tsx b/frontend/src/pages/DashboardPage.tsx index 0742d6c..021d542 100644 --- a/frontend/src/pages/DashboardPage.tsx +++ b/frontend/src/pages/DashboardPage.tsx @@ -376,3 +376,5 @@ const DashboardPage: React.FC = () => { }; export default DashboardPage; + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/frontend/src/pages/OrganizationPage.tsx b/frontend/src/pages/OrganizationPage.tsx index 9f72d30..660710e 100644 --- a/frontend/src/pages/OrganizationPage.tsx +++ b/frontend/src/pages/OrganizationPage.tsx @@ -14,7 +14,7 @@ const OrganizationPage: React.FC = () => { // Create a placeholder organization object // ProfileManager will fetch actual data const organization: Organization = { - id: parseInt(id || '0'), + id: parseInt(id || '0', 10), category: categoryId, name: '', // Will be loaded by ProfileManager logo_url: null,