diff --git a/client/src/Hooks/useMonitorControls.js b/client/src/Hooks/useMonitorControls.js index b7d2ebe21..b47603b58 100644 --- a/client/src/Hooks/useMonitorControls.js +++ b/client/src/Hooks/useMonitorControls.js @@ -5,12 +5,10 @@ import { createToast } from "../Utils/toastUtils"; const usePauseMonitor = ({ monitorId, triggerUpdate }) => { const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(undefined); - const [monitor, setMonitor] = useState(undefined); const pauseMonitor = async () => { try { - setIsLoading(false); + setIsLoading(true); const res = await networkService.pauseMonitorById({ monitorId }); - setMonitor(res.data.data); createToast({ body: res.data.data.isActive ? "Monitor resumed successfully"