mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 01:05:20 +03:00
Improve restart from UI
This commit is contained in:
parent
b9169232ae
commit
b9e7003f60
@ -1,10 +1,10 @@
|
|||||||
import { h, Fragment } from 'preact';
|
import { h, Fragment } from 'preact';
|
||||||
import Dialog from './Dialog';
|
import Dialog from './Dialog';
|
||||||
import { useCallback, useEffect, useState } from 'preact/hooks';
|
import { useEffect } from 'preact/hooks';
|
||||||
import { useRestart } from '../api/mqtt';
|
import { useRestart } from '../api/mqtt';
|
||||||
|
|
||||||
export default function DialogRestart({ show, setShow }) {
|
export default function DialogRestart({ show, setShow }) {
|
||||||
const { payload: restartedMessage = null, send: sendRestart } = useRestart();
|
const { send: sendRestart } = useRestart();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (show === 2) {
|
if (show === 2) {
|
||||||
@ -17,7 +17,7 @@ export default function DialogRestart({ show, setShow }) {
|
|||||||
try {
|
try {
|
||||||
const response = await fetch('/api/config', { method: 'GET' });
|
const response = await fetch('/api/config', { method: 'GET' });
|
||||||
if (await response.status === 200) {
|
if (await response.status === 200) {
|
||||||
break;;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user