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-title" content="Multi Roomba Rover" />
<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">
</head>
<body>
+9 -4
View File
@@ -151,21 +151,26 @@ function AppWithProviders({ layout, isDesktop, fullscreen }) {
const {
value: helpSettings,
status: helpStatus,
save: saveHelpSettings,
} = useSettingsNamespace('help', { showOnLoad: true });
const [helpVisible, setHelpVisible] = useState(false);
useEffect(() => {
if (helpSettings?.showOnLoad !== false) {
setHelpVisible(true);
if (helpStatus === 'ready') {
setHelpVisible(helpSettings?.showOnLoad !== false);
}
}, [helpSettings?.showOnLoad]);
}, [helpStatus, helpSettings?.showOnLoad]);
const openHelp = useCallback(() => setHelpVisible(true), []);
const closeHelp = useCallback(() => setHelpVisible(false), []);
const setShowOnLoad = useCallback(
(enabled) => {
saveHelpSettings((current) => ({ ...(current ?? {}), showOnLoad: Boolean(enabled) }));
const next = Boolean(enabled);
saveHelpSettings((current) => ({ ...(current ?? {}), showOnLoad: next }));
if (!next) {
setHelpVisible(false);
}
},
[saveHelpSettings],
);