fix "dont show again"

This commit is contained in:
legop3
2025-12-05 00:08:40 -05:00
parent 9f0bb8bd24
commit 2b1122dce9
3 changed files with 16 additions and 11 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -11,7 +11,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" /> <meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
<title>Multi Roomba Rover</title> <title>Multi Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-B-bJbbPY.js"></script> <script type="module" crossorigin src="/assets/index-CB1QIk24.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-4BBPmLYK.css"> <link rel="stylesheet" crossorigin href="/assets/index-4BBPmLYK.css">
</head> </head>
<body> <body>
+9 -4
View File
@@ -151,21 +151,26 @@ function AppWithProviders({ layout, isDesktop, fullscreen }) {
const { const {
value: helpSettings, value: helpSettings,
status: helpStatus,
save: saveHelpSettings, save: saveHelpSettings,
} = useSettingsNamespace('help', { showOnLoad: true }); } = useSettingsNamespace('help', { showOnLoad: true });
const [helpVisible, setHelpVisible] = useState(false); const [helpVisible, setHelpVisible] = useState(false);
useEffect(() => { useEffect(() => {
if (helpSettings?.showOnLoad !== false) { if (helpStatus === 'ready') {
setHelpVisible(true); setHelpVisible(helpSettings?.showOnLoad !== false);
} }
}, [helpSettings?.showOnLoad]); }, [helpStatus, helpSettings?.showOnLoad]);
const openHelp = useCallback(() => setHelpVisible(true), []); const openHelp = useCallback(() => setHelpVisible(true), []);
const closeHelp = useCallback(() => setHelpVisible(false), []); const closeHelp = useCallback(() => setHelpVisible(false), []);
const setShowOnLoad = useCallback( const setShowOnLoad = useCallback(
(enabled) => { (enabled) => {
saveHelpSettings((current) => ({ ...(current ?? {}), showOnLoad: Boolean(enabled) })); const next = Boolean(enabled);
saveHelpSettings((current) => ({ ...(current ?? {}), showOnLoad: next }));
if (!next) {
setHelpVisible(false);
}
}, },
[saveHelpSettings], [saveHelpSettings],
); );