mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
restart animation on factory reset
This commit is contained in:
@@ -86,8 +86,10 @@ const SystemStatusForm: FC = () => {
|
|||||||
const restart = async () => {
|
const restart = async () => {
|
||||||
setProcessing(true);
|
setProcessing(true);
|
||||||
try {
|
try {
|
||||||
await SystemApi.restart();
|
const response = await SystemApi.restart();
|
||||||
|
if (response.status === 200) {
|
||||||
setRestarting(true);
|
setRestarting(true);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_LOADING()), { variant: 'error' });
|
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_LOADING()), { variant: 'error' });
|
||||||
} finally {
|
} finally {
|
||||||
@@ -208,7 +210,7 @@ const SystemStatusForm: FC = () => {
|
|||||||
setProcessing(true);
|
setProcessing(true);
|
||||||
try {
|
try {
|
||||||
await SystemApi.factoryReset();
|
await SystemApi.factoryReset();
|
||||||
enqueueSnackbar(LL.SYSTEM_FACTORY_TEXT(), { variant: 'info' });
|
setRestarting(true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' });
|
enqueueSnackbar(extractErrorMessage(error, LL.PROBLEM_UPDATING()), { variant: 'error' });
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user