fix uptime chart legends, set initial loading state to true to avoid extra render

This commit is contained in:
Alex Holliday committed 2025-01-31 13:45:07 -08:00
1 parent 49c58ce2ae
commit f218b60591
2 files changed
+23 -21

No files matched your search

@@ -4,14 +4,13 @@ import { logger } from "../../../../Utils/Logger";
import { useNavigate } from "react-router-dom";
export const useMonitorFetch = ({ authToken, monitorId, dateRange }) => {
const [monitorIsLoading, setMonitorsIsLoading] = useState(false);
const [monitorIsLoading, setMonitorsIsLoading] = useState(true);
const [monitor, setMonitor] = useState(undefined);
const navigate = useNavigate();
useEffect(() => {
const fetchMonitors = async () => {
try {
setMonitorsIsLoading(true);
const res = await networkService.getUptimeDetailsById({
authToken: authToken,
monitorId: monitorId,