From 880195efde8aece9e9086902d6c7ca7cd232cc6a Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 30 Jan 2025 14:26:18 -0800 Subject: [PATCH] set initial loading state to true, skip one render --- Client/src/Pages/Incidents/Hooks/useChecksFetch.jsx | 2 +- Client/src/Pages/Incidents/Hooks/useMonitorsFetch.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/src/Pages/Incidents/Hooks/useChecksFetch.jsx b/Client/src/Pages/Incidents/Hooks/useChecksFetch.jsx index 57444ad05..614006792 100644 --- a/Client/src/Pages/Incidents/Hooks/useChecksFetch.jsx +++ b/Client/src/Pages/Incidents/Hooks/useChecksFetch.jsx @@ -7,7 +7,7 @@ const useChecksFetch = ({ selectedMonitor, filter, dateRange, page, rowsPerPage const { authToken, user } = useSelector((state) => state.auth); //Local - const [isLoading, setIsLoading] = useState(false); + const [isLoading, setIsLoading] = useState(true); const [networkError, setNetworkError] = useState(false); const [checks, setChecks] = useState(undefined); const [checksCount, setChecksCount] = useState(undefined); diff --git a/Client/src/Pages/Incidents/Hooks/useMonitorsFetch.jsx b/Client/src/Pages/Incidents/Hooks/useMonitorsFetch.jsx index 0ffd18571..20043e80d 100644 --- a/Client/src/Pages/Incidents/Hooks/useMonitorsFetch.jsx +++ b/Client/src/Pages/Incidents/Hooks/useMonitorsFetch.jsx @@ -3,7 +3,7 @@ import { networkService } from "../../../main"; import { createToast } from "../../../Utils/toastUtils"; const useMonitorsFetch = ({ authToken, teamId }) => { //Local state - const [isLoading, setIsLoading] = useState(false); + const [isLoading, setIsLoading] = useState(true); const [networkError, setNetworkError] = useState(false); const [monitors, setMonitors] = useState(undefined);