mirror of
https://dev.azure.com/tstanciu94/NetworkResurrector/_git/NetworkResurrector
synced 2025-06-21 19:17:04 +03:00
disable automatic ping for guest users
This commit is contained in:
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…
x
Reference in New Issue
Block a user