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-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
@@ -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],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user