|
@@ -4,9 +4,6 @@ import Layout from '../components/Layout';
|
|
import { useLogoutMutation, useRestartMutation, useUpdateMutation, useVersionQuery } from '../generated/graphql';
|
|
import { useLogoutMutation, useRestartMutation, useUpdateMutation, useVersionQuery } from '../generated/graphql';
|
|
import { useRef, useState } from 'react';
|
|
import { useRef, useState } from 'react';
|
|
|
|
|
|
-// Necessary to avoid flickering when initiating an update or restart
|
|
|
|
-const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
|
-
|
|
|
|
const Settings: NextPage = () => {
|
|
const Settings: NextPage = () => {
|
|
const toast = useToast();
|
|
const toast = useToast();
|
|
const restartDisclosure = useDisclosure();
|
|
const restartDisclosure = useDisclosure();
|
|
@@ -55,7 +52,6 @@ const Settings: NextPage = () => {
|
|
setLoading(true);
|
|
setLoading(true);
|
|
try {
|
|
try {
|
|
restart();
|
|
restart();
|
|
- await wait(2000);
|
|
|
|
logout();
|
|
logout();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
handleError(error);
|
|
handleError(error);
|
|
@@ -68,7 +64,6 @@ const Settings: NextPage = () => {
|
|
setLoading(true);
|
|
setLoading(true);
|
|
try {
|
|
try {
|
|
update();
|
|
update();
|
|
- await wait(2000);
|
|
|
|
logout();
|
|
logout();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
handleError(error);
|
|
handleError(error);
|