diff --git a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx index 6a7e3529b..2faf6da8d 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx @@ -118,7 +118,7 @@ function SessionList(props: Props) { useEffect(() => { - if (!hasNoRecordings) { + if (!hasNoRecordings || !activeSite) { return; } @@ -129,7 +129,7 @@ function SessionList(props: Props) { }, STATUS_FREQUENCY); return () => clearInterval(sessionStatusTimeOut); - }, [hasNoRecordings]); + }, [hasNoRecordings, activeSite]); useEffect(() => { @@ -137,12 +137,12 @@ function SessionList(props: Props) { return; } - if (statusData.status === 2) { // recording && processed + if (statusData.status === 2 && activeSite) { // recording && processed props.updateProjectRecordingStatus(activeSite.id, true); props.fetchSessions(null, true); clearInterval(sessionStatusTimeOut); } - }, [statusData]); + }, [statusData, activeSite]); useEffect(() => { const id = setInterval(() => { @@ -206,7 +206,7 @@ function SessionList(props: Props) { return ( - {hasNoRecordings && statusData.status >= 1 ? : ( + {hasNoRecordings && statusData.status == 1 ? : ( <>