fix: bandmap opened or closed is now persistent over restart

This commit is contained in:
2026-06-20 18:59:12 +02:00
parent 95d37da3bb
commit 4a6ea45665
2 changed files with 9 additions and 3 deletions
+8 -3
View File
@@ -685,7 +685,12 @@ export default function App() {
}, []); }, []);
// Single band map docked beside the table (toggled by the toolbar button, // Single band map docked beside the table (toggled by the toolbar button,
// visible across tabs). Independent of the multi-band "Band Map" tab. // 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'>( const [bandMapSide, setBandMapSide] = useState<'left' | 'right'>(
() => (localStorage.getItem('bandmap.side') === 'left' ? 'left' : 'right'), () => (localStorage.getItem('bandmap.side') === 'left' ? 'left' : 'right'),
); );
@@ -2879,7 +2884,7 @@ export default function App() {
<Button <Button
variant={showBandMap ? 'default' : 'outline'} variant={showBandMap ? 'default' : 'outline'}
size="sm" size="sm"
onClick={() => setShowBandMap((v) => !v)} onClick={() => setBandMapShown(!showBandMap)}
title="Toggle a single band map docked on the side (use the Band Map tab for several at once)" title="Toggle a single band map docked on the side (use the Band Map tab for several at once)"
className="h-8" className="h-8"
> >
@@ -3642,7 +3647,7 @@ export default function App() {
spotStatus={spotStatus} spotStatus={spotStatus}
currentFreqHz={band && freqMhz ? Math.round(parseFloat(freqMhz) * 1_000_000) : 0} currentFreqHz={band && freqMhz ? Math.round(parseFloat(freqMhz) * 1_000_000) : 0}
onSpotClick={handleSpotClick} onSpotClick={handleSpotClick}
onClose={() => setShowBandMap(false)} onClose={() => setBandMapShown(false)}
/> />
</div> </div>
)} )}
+1
View File
@@ -12,6 +12,7 @@ import { GetUIPref, SetUIPref } from '../../wailsjs/go/main/App';
const PORTABLE_KEYS = [ const PORTABLE_KEYS = [
'hamlog.qsoLimit', // QSO list page size 'hamlog.qsoLimit', // QSO list page size
'bandmap.side', // band map docked left / right 'bandmap.side', // band map docked left / right
'bandmap.show', // band map open / closed
'opslog.autofocusWB', // auto-focus Worked-before 'opslog.autofocusWB', // auto-focus Worked-before
'hamlog.filterPresets', // Filter Builder saved presets 'hamlog.filterPresets', // Filter Builder saved presets
'opslog.showRotor', // rotor compass shown next to the keyers 'opslog.showRotor', // rotor compass shown next to the keyers