diff --git a/public/pages/DetectorDetail/containers/DetectorDetail.tsx b/public/pages/DetectorDetail/containers/DetectorDetail.tsx index 14c10a7a..20f7344f 100644 --- a/public/pages/DetectorDetail/containers/DetectorDetail.tsx +++ b/public/pages/DetectorDetail/containers/DetectorDetail.tsx @@ -161,7 +161,10 @@ export const DetectorDetail = (props: DetectorDetailProps) => { core.notifications.toasts.addDanger('Error getting all indices'); }); }; - getInitialIndices(); + // only need to check if indices exist after detector finishes loading + if (!isLoadingDetector) { + getInitialIndices(); + } }, [detector]); useEffect(() => { @@ -188,7 +191,7 @@ export const DetectorDetail = (props: DetectorDetailProps) => { // If the detector state was changed after opening the stop detector modal, // re-check if any jobs are running, and close the modal if it's not needed anymore useEffect(() => { - if (!isRTJobRunning && !isHistoricalJobRunning) { + if (!isRTJobRunning && !isHistoricalJobRunning && !isEmpty(detector)) { hideStopDetectorModal(); } }, [detector]);