mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
fix "dont show again"
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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
@@ -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],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user