Citation: persist Nav Source Selector bearing-pointer choice across sessions
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -76,7 +76,11 @@ export default function App() {
|
||||
const [profile, setProfile] = useState(() => localStorage.getItem('cockpitProfile') || 'g1000');
|
||||
// Citation Nav Source Selector bearing-pointer sources (p24): pointer 1 = cyan
|
||||
// circle, pointer 2 = white diamond. Each OFF/VORn/ADFn/FMSn. Shared PFD↔RMU.
|
||||
const [navSrc, setNavSrc] = useState({ brg1: 'VOR1', brg2: 'VOR2' });
|
||||
const [navSrc, setNavSrc] = useState(() => {
|
||||
try { return JSON.parse(localStorage.getItem('citNavSrc')) || { brg1: 'VOR1', brg2: 'VOR2' }; }
|
||||
catch { return { brg1: 'VOR1', brg2: 'VOR2' }; }
|
||||
});
|
||||
useEffect(() => { localStorage.setItem('citNavSrc', JSON.stringify(navSrc)); }, [navSrc]);
|
||||
const [profMenu, setProfMenu] = useState(false);
|
||||
const PROF = PROFILES[profile] || PROFILES.g1000;
|
||||
const TABS = PROF.tabs;
|
||||
|
||||
Reference in New Issue
Block a user