disable automatic ping for guest users
parent
63c7d946e9
commit
feab019df1
|
@ -65,6 +65,7 @@ const WakeComponent = ({ machine, addLog, disabled }) => {
|
||||||
}, [log, success, error, startingTime, machine.machineId]);
|
}, [log, success, error, startingTime, machine.machineId]);
|
||||||
|
|
||||||
const pingInLoop = useCallback(async () => {
|
const pingInLoop = useCallback(async () => {
|
||||||
|
if (disabled) return;
|
||||||
await post(
|
await post(
|
||||||
routes.pingMachine,
|
routes.pingMachine,
|
||||||
{ machineId: machine.machineId },
|
{ machineId: machine.machineId },
|
||||||
|
@ -82,7 +83,7 @@ const WakeComponent = ({ machine, addLog, disabled }) => {
|
||||||
onError: () => {}
|
onError: () => {}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}, [machine, log, pingInterval]);
|
}, [machine, log, pingInterval, disabled]);
|
||||||
|
|
||||||
useEffect(pingInLoop, [trigger, pingInLoop]);
|
useEffect(pingInLoop, [trigger, pingInLoop]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue