removed conditional calling of hook and added early return in useHardwareMonitorsFetch

This commit is contained in:
Vishnu Sreekumaran Nair committed 2025-03-18 12:18:52 -04:00
1 parent 8df78089e6
commit 5c74c0e452
2 files changed
+6 -1

No files matched your search

@@ -2,6 +2,11 @@ import { useEffect, useState } from "react";
import { networkService } from "../../../../main";
const useHardwareMonitorsFetch = ({ monitorId, dateRange }) => {
// Abort early if creating monitor
if (!monitorId) {
return { monitor: null, isLoading: false, networkError: null };
}
const [isLoading, setIsLoading] = useState(true);
const [networkError, setNetworkError] = useState(false);
const [monitor, setMonitor] = useState(undefined);