return early if creating
This commit is contained in:
1 parent
08af15f8a5
commit
5165d61793
2 files changed
+3
-1
No files matched your search
@@ -33,6 +33,7 @@ const CreateStatus = () => {
|
||||
useDUStatusPageFetchByUrl({
|
||||
url,
|
||||
timeFrame: 30,
|
||||
isCreate,
|
||||
});
|
||||
|
||||
const [monitors, monitorsIsLoading, monitorsNetworkError] = useMonitorsFetch();
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user