Compare commits

...

2 Commits

Author SHA1 Message Date
Marc Brooks 36b05a80cf
Merge f23480792b into 4090592112 2025-11-04 15:12:09 +01:00
Marc Brooks 4090592112
chore: add delay before forced page-reload (#916) 2025-11-04 15:12:03 +01:00
3 changed files with 6 additions and 0 deletions

View File

@ -313,6 +313,8 @@ export default function SettingsAdvancedRoute() {
text={m.advanced_reset_config_button()} text={m.advanced_reset_config_button()}
onClick={() => { onClick={() => {
handleResetConfig(); handleResetConfig();
// Add 2s delay between resetting the configuration and calling reload() to prevent reload from interrupting the RPC call to reset things.
await sleep(2000);
window.location.reload(); window.location.reload();
}} }}
/> />

View File

@ -11,6 +11,8 @@ export default function SettingsGeneralRebootRoute() {
const onClose = useCallback(() => { const onClose = useCallback(() => {
navigate(".."); // back to the devices.$id.settings page navigate(".."); // back to the devices.$id.settings page
// Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
await sleep(1000);
window.location.reload(); // force a full reload to ensure the current device/cloud UI version is loaded window.location.reload(); // force a full reload to ensure the current device/cloud UI version is loaded
}, [navigate]); }, [navigate]);

View File

@ -23,6 +23,8 @@ export default function SettingsGeneralUpdateRoute() {
const onClose = useCallback(() => { const onClose = useCallback(() => {
navigate(".."); // back to the devices.$id.settings page navigate(".."); // back to the devices.$id.settings page
// Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
await sleep(1000);
window.location.reload(); // force a full reload to ensure the current device/cloud UI version is loaded window.location.reload(); // force a full reload to ensure the current device/cloud UI version is loaded
}, [navigate]); }, [navigate]);