File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { TextAreaWithLabel } from "@components/TextArea";
1212import { isOnDevice } from "@/main" ;
1313import notifications from "@/notifications" ;
1414import { m } from "@localizations/messages.js" ;
15+ import { sleep } from "@/utils" ;
1516
1617export default function SettingsAdvancedRoute ( ) {
1718 const { send } = useJsonRpc ( ) ;
@@ -311,7 +312,7 @@ export default function SettingsAdvancedRoute() {
311312 size = "SM"
312313 theme = "light"
313314 text = { m . advanced_reset_config_button ( ) }
314- onClick = { ( ) => {
315+ onClick = { async ( ) => {
315316 handleResetConfig ( ) ;
316317 // Add 2s delay between resetting the configuration and calling reload() to prevent reload from interrupting the RPC call to reset things.
317318 await sleep ( 2000 ) ;
Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ import { useNavigate } from "react-router";
44import { useJsonRpc } from "@hooks/useJsonRpc" ;
55import { Button } from "@components/Button" ;
66import { m } from "@localizations/messages.js" ;
7+ import { sleep } from "@/utils" ;
78
89export default function SettingsGeneralRebootRoute ( ) {
910 const navigate = useNavigate ( ) ;
1011 const { send } = useJsonRpc ( ) ;
1112
12- const onClose = useCallback ( ( ) => {
13+ const onClose = useCallback ( async ( ) => {
1314 navigate ( ".." ) ; // back to the devices.$id.settings page
1415 // Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
1516 await sleep ( 1000 ) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default function SettingsGeneralUpdateRoute() {
2121 const { setModalView, otaState } = useUpdateStore ( ) ;
2222 const { send } = useJsonRpc ( ) ;
2323
24- const onClose = useCallback ( ( ) => {
24+ const onClose = useCallback ( async ( ) => {
2525 navigate ( ".." ) ; // back to the devices.$id.settings page
2626 // Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
2727 await sleep ( 1000 ) ;
You can’t perform that action at this time.
0 commit comments