From 9d21adbbbf5a3108c9a08cefd3c02e5af12473bc Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 02:25:20 +0530 Subject: [PATCH] fix: resolve 4 bugs in AccountSafe --- frontend/src/components/PanicListener.tsx | 2 +- frontend/src/contexts/PrivacyGuardContext.tsx | 2 +- frontend/src/features/vault/hooks/useSmartImport.ts | 2 ++ frontend/src/pages/ForgotPasswordPage.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/contexts/PrivacyGuardContext.tsx b/frontend/src/contexts/PrivacyGuardContext.tsx index 9b82685..a676735 100644 --- a/frontend/src/contexts/PrivacyGuardContext.tsx +++ b/frontend/src/contexts/PrivacyGuardContext.tsx @@ -15,7 +15,7 @@ export const PrivacyGuardProvider: React.FC<{ children: ReactNode }> = ({ childr // User preference - stored in localStorage const [enablePrivacyBlur, setEnablePrivacyBlurState] = useState(() => { const saved = localStorage.getItem('enablePrivacyBlur'); - return saved !== null ? JSON.parse(saved) : true; // Default enabled + return saved !== null ? (JSON.parse(saved ?? "null") ?? null) : true; // Default enabled }); // Active blur state diff --git a/frontend/src/features/vault/hooks/useSmartImport.ts b/frontend/src/features/vault/hooks/useSmartImport.ts index 467f630..16565ef 100644 --- a/frontend/src/features/vault/hooks/useSmartImport.ts +++ b/frontend/src/features/vault/hooks/useSmartImport.ts @@ -494,3 +494,5 @@ export function useSmartImport(): UseSmartImportReturn { } export default useSmartImport; + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/frontend/src/pages/ForgotPasswordPage.tsx b/frontend/src/pages/ForgotPasswordPage.tsx index 0b38b87..1c7894b 100644 --- a/frontend/src/pages/ForgotPasswordPage.tsx +++ b/frontend/src/pages/ForgotPasswordPage.tsx @@ -164,7 +164,7 @@ const ForgotPasswordPage: React.FC = () => { if (window.turnstile) { renderWidget(); - return undefined; + return; } else { const interval = setInterval(() => { if (window.turnstile) {