disable automatic ping for guest users

master
Tudor Stanciu 2023-04-17 04:05:36 +03:00
parent 63c7d946e9
commit feab019df1
1 changed files with 2 additions and 1 deletions

View File

@ -65,6 +65,7 @@ const WakeComponent = ({ machine, addLog, disabled }) => {
}, [log, success, error, startingTime, machine.machineId]);
const pingInLoop = useCallback(async () => {
if (disabled) return;
await post(
routes.pingMachine,
{ machineId: machine.machineId },
@ -82,7 +83,7 @@ const WakeComponent = ({ machine, addLog, disabled }) => {
onError: () => {}
}
);
}, [machine, log, pingInterval]);
}, [machine, log, pingInterval, disabled]);
useEffect(pingInLoop, [trigger, pingInLoop]);