mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 01:05:20 +03:00
improved user experience
This commit is contained in:
parent
4b538d54b9
commit
dc732f192c
@ -13,11 +13,12 @@ export default function DialogRestart({ show, setShow }) {
|
|||||||
setDialogTitle('Server-initiated startup');
|
setDialogTitle('Server-initiated startup');
|
||||||
setShow(false);
|
setShow(false);
|
||||||
}
|
}
|
||||||
}, [detectRestarted]);
|
}, [detectRestarted]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const waitPlease = async () => {
|
const waitPlease = async () => {
|
||||||
const delay = ms => new Promise(res => setTimeout(res, ms));
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
||||||
await delay(3456);
|
await delay(3456);
|
||||||
|
/* eslint-disable no-constant-condition */
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/config', { method: 'GET' });
|
const response = await fetch('/api/config', { method: 'GET' });
|
||||||
@ -33,11 +34,11 @@ export default function DialogRestart({ show, setShow }) {
|
|||||||
sendRestart();
|
sendRestart();
|
||||||
setShow(false);
|
setShow(false);
|
||||||
waitPlease();
|
waitPlease();
|
||||||
});
|
}, [show]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const handleDismiss = useCallback(() => {
|
const handleDismiss = useCallback(() => {
|
||||||
setShow(false);
|
setShow(false);
|
||||||
});
|
}, [show]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user