From 818bb30bde75da41714f8df16453d5d49fd70178 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Tue, 13 Aug 2024 18:55:11 +0300 Subject: [PATCH] Show a toast when restarting the device --- frontend/src/pages/System/index.tsx | 11 +- src/sensesp/net/web/autogen/frontend_files.h | 3796 +++++++++--------- 2 files changed, 1908 insertions(+), 1899 deletions(-) diff --git a/frontend/src/pages/System/index.tsx b/frontend/src/pages/System/index.tsx index d82dcf4f8..e9e648f27 100644 --- a/frontend/src/pages/System/index.tsx +++ b/frontend/src/pages/System/index.tsx @@ -319,6 +319,7 @@ function AuthCard(): JSX.Element { */ function RestartCard(): JSX.Element { const [httpErrorText, setHttpErrorText] = useState(""); + const [showRestartToast, setShowRestartToast] = useState(false); const id = useId(); @@ -336,6 +337,7 @@ function RestartCard(): JSX.Element { setTimeout(() => { window.location.reload(); }, 5000); + setShowRestartToast(true); } catch (e) { setHttpErrorText(`Error restarting the device: ${e}`); } @@ -344,12 +346,19 @@ function RestartCard(): JSX.Element { return ( <> setHttpErrorText("")} >

Failed to restart: {httpErrorText}

+ {setShowRestartToast(false)}} + > +

Restarting the device...

+