implement config
This commit is contained in:
1 parent
73df0837bb
commit
e9c7f1d7be
4 files changed
+52
-9
No files matched your search
@@ -28,7 +28,7 @@ const getMonitorWithPercentage = (monitor, theme) => {
|
||||
};
|
||||
};
|
||||
|
||||
const useStatusPageFetch = () => {
|
||||
const useStatusPageFetch = (isCreate = false) => {
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [networkError, setNetworkError] = useState(false);
|
||||
const [statusPage, setStatusPage] = useState(undefined);
|
||||
@@ -59,9 +59,13 @@ const useStatusPageFetch = () => {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}, [authToken, theme]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isCreate === true) {
|
||||
return;
|
||||
}
|
||||
fetchStatusPage();
|
||||
}, [fetchStatusPage]);
|
||||
}, [isCreate, fetchStatusPage]);
|
||||
|
||||
return [statusPage, monitors, isLoading, networkError, fetchStatusPage];
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user