From 58624687c68c578d6c275735f8bf8870b4714b94 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 10 Jul 2023 13:41:29 +0200 Subject: [PATCH] fix(ui): check for activeSitre before checking for sessions --- .../components/SessionList/SessionList.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 ? : ( <>