From 5165d6179357405c0b61ab128ee36c0dd848ee95 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 24 Feb 2025 16:02:35 -0800 Subject: [PATCH] return early if creating --- src/Pages/DistributedUptimeStatus/Create/index.jsx | 1 + .../Status/Hooks/useDUStatusPageFetchByUrl.jsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Pages/DistributedUptimeStatus/Create/index.jsx b/src/Pages/DistributedUptimeStatus/Create/index.jsx index d658b4cff..92144b1df 100644 --- a/src/Pages/DistributedUptimeStatus/Create/index.jsx +++ b/src/Pages/DistributedUptimeStatus/Create/index.jsx @@ -33,6 +33,7 @@ const CreateStatus = () => { useDUStatusPageFetchByUrl({ url, timeFrame: 30, + isCreate, }); const [monitors, monitorsIsLoading, monitorsNetworkError] = useMonitorsFetch(); diff --git a/src/Pages/DistributedUptimeStatus/Status/Hooks/useDUStatusPageFetchByUrl.jsx b/src/Pages/DistributedUptimeStatus/Status/Hooks/useDUStatusPageFetchByUrl.jsx index 8ceb8f611..b1b0542a4 100644 --- a/src/Pages/DistributedUptimeStatus/Status/Hooks/useDUStatusPageFetchByUrl.jsx +++ b/src/Pages/DistributedUptimeStatus/Status/Hooks/useDUStatusPageFetchByUrl.jsx @@ -5,7 +5,7 @@ import { useSelector } from "react-redux"; import { useTheme } from "@emotion/react"; import { useMonitorUtils } from "../../../../Hooks/useMonitorUtils"; -const useDUStatusPageFetchByUrl = ({ url, timeFrame }) => { +const useDUStatusPageFetchByUrl = ({ url, timeFrame, isCreate = false }) => { const [isLoading, setIsLoading] = useState(true); const [networkError, setNetworkError] = useState(false); const [statusPage, setStatusPage] = useState(undefined); @@ -16,6 +16,7 @@ const useDUStatusPageFetchByUrl = ({ url, timeFrame }) => { const { getMonitorWithPercentage } = useMonitorUtils(); useEffect(() => { + if (isCreate) return; const fetchStatusPageByUrl = async () => { try { const response = await networkService.getDistributedStatusPageByUrl({