From 221b4960dc4c6dd3cca822c72f2e7ec48cbdeed4 Mon Sep 17 00:00:00 2001 From: ElMoribond Date: Mon, 21 Jun 2021 09:34:59 +0200 Subject: [PATCH] Add ability to restart --- web/src/AppBar.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/src/AppBar.jsx b/web/src/AppBar.jsx index 8a43e97ed..3af7b2d1a 100644 --- a/web/src/AppBar.jsx +++ b/web/src/AppBar.jsx @@ -14,6 +14,7 @@ import { useRestart } from './api/mqtt'; export default function AppBar() { const [showMoreMenu, setShowMoreMenu] = useState(false); const [showDialog, setShowDialog] = useState(false); + const [showDialogWait, setShowDialogWait] = useState(false); const { setDarkMode } = useDarkMode(); const { send: sendRestart } = useRestart(); @@ -37,6 +38,7 @@ export default function AppBar() { const handleClickRestartDialog = useCallback(() => { setShowDialog(false); + setShowDialogWait(true); sendRestart(); }, [setShowDialog]); @@ -72,6 +74,12 @@ export default function AppBar() { { text: 'Cancel', onClick: handleDismissRestartDialog }, ]} /> + ) : null}, + {showDialogWait ? ( + ) : null} );