From dc732f192c694c0b80813efa3ff085d2d6771031 Mon Sep 17 00:00:00 2001 From: ElMoribond Date: Tue, 13 Jul 2021 11:17:03 +0200 Subject: [PATCH] improved user experience --- web/src/components/DialogRestart.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/components/DialogRestart.jsx b/web/src/components/DialogRestart.jsx index 4f351c1fb..4f88b5fe0 100644 --- a/web/src/components/DialogRestart.jsx +++ b/web/src/components/DialogRestart.jsx @@ -13,11 +13,12 @@ export default function DialogRestart({ show, setShow }) { setDialogTitle('Server-initiated startup'); setShow(false); } - }, [detectRestarted]); + }, [detectRestarted]); // eslint-disable-line react-hooks/exhaustive-deps const waitPlease = async () => { const delay = ms => new Promise(res => setTimeout(res, ms)); await delay(3456); + /* eslint-disable no-constant-condition */ while (true) { try { const response = await fetch('/api/config', { method: 'GET' }); @@ -33,11 +34,11 @@ export default function DialogRestart({ show, setShow }) { sendRestart(); setShow(false); waitPlease(); - }); + }, [show]); // eslint-disable-line react-hooks/exhaustive-deps const handleDismiss = useCallback(() => { setShow(false); - }); + }, [show]); // eslint-disable-line react-hooks/exhaustive-deps return (