diff --git a/src/pages/stock/screener/hooks/useCanvasLayout.js b/src/pages/stock/screener/hooks/useCanvasLayout.js index c37dbb3..413192b 100644 --- a/src/pages/stock/screener/hooks/useCanvasLayout.js +++ b/src/pages/stock/screener/hooks/useCanvasLayout.js @@ -31,14 +31,14 @@ export function useCanvasLayout(initialPositions) { const updateNodePosition = useCallback((nodeId, pos) => { setPositions((prev) => { const next = { ...prev, [nodeId]: { x: pos.x, y: pos.y } }; - try { localStorage.setItem(STORAGE_KEY, JSON.stringify(next)); } catch {} + try { localStorage.setItem(STORAGE_KEY, JSON.stringify(next)); } catch { /* ignore quota/security errors */ } return next; }); }, []); const reset = useCallback(() => { setPositions(initialPositions); - try { localStorage.removeItem(STORAGE_KEY); } catch {} + try { localStorage.removeItem(STORAGE_KEY); } catch { /* ignore security errors */ } }, [initialPositions]); return { positions, updateNodePosition, reset }; diff --git a/src/pages/stock/screener/hooks/useScreenerMode.js b/src/pages/stock/screener/hooks/useScreenerMode.js index 574ea88..9721b9c 100644 --- a/src/pages/stock/screener/hooks/useScreenerMode.js +++ b/src/pages/stock/screener/hooks/useScreenerMode.js @@ -18,7 +18,7 @@ export function useScreenerMode() { const setMode = (m) => { if (!VALID_MODES.has(m)) return; setModeState(m); - try { localStorage.setItem(STORAGE_KEY, m); } catch {} + try { localStorage.setItem(STORAGE_KEY, m); } catch { /* ignore quota/security errors */ } }; return { mode, setMode }; diff --git a/src/test-setup.js b/src/test-setup.js index e8ff5ef..181b29e 100644 --- a/src/test-setup.js +++ b/src/test-setup.js @@ -1,3 +1,4 @@ +import { beforeEach } from 'vitest'; import '@testing-library/jest-dom/vitest'; // jsdom polyfills for react-flow