return early if creating

This commit is contained in:
Alex Holliday
2025-02-24 16:02:35 -08:00
parent 08af15f8a5
commit 5165d61793
2 changed files with 3 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ const CreateStatus = () => {
useDUStatusPageFetchByUrl({
url,
timeFrame: 30,
isCreate,
});
const [monitors, monitorsIsLoading, monitorsNetworkError] = useMonitorsFetch();

View File

@@ -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({