From 4a6ea45665dd6f9ec6fc3d453b5c86abb6f6a02a Mon Sep 17 00:00:00 2001 From: rouggy Date: Sat, 20 Jun 2026 18:59:12 +0200 Subject: [PATCH] fix: bandmap opened or closed is now persistent over restart --- frontend/src/App.tsx | 11 ++++++++--- frontend/src/lib/uiPref.ts | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 81b3994..f38fb51 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -685,7 +685,12 @@ export default function App() { }, []); // Single band map docked beside the table (toggled by the toolbar button, // visible across tabs). Independent of the multi-band "Band Map" tab. - const [showBandMap, setShowBandMap] = useState(false); + const [showBandMap, setShowBandMap] = useState(() => localStorage.getItem('bandmap.show') === '1'); + // Persist the Band Map open/closed state (portable) so it survives a restart. + const setBandMapShown = useCallback((v: boolean) => { + setShowBandMap(v); + writeUiPref('bandmap.show', v ? '1' : '0'); + }, []); const [bandMapSide, setBandMapSide] = useState<'left' | 'right'>( () => (localStorage.getItem('bandmap.side') === 'left' ? 'left' : 'right'), ); @@ -2879,7 +2884,7 @@ export default function App() {