diff --git a/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx b/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx index 94f97293c..3a599dfdf 100644 --- a/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx +++ b/frontend/app/components/shared/LiveSessionList/LiveSessionList.tsx @@ -47,26 +47,18 @@ function LiveSessionList() { const _filter = { ...filter }; let shouldUpdate = false; - - // Set default sort if not already set if (sortOptions[1] && !filter.sort) { _filter.sort = sortOptions[1].value; shouldUpdate = true; } - - // Only update filters if there's a change if (shouldUpdate) { searchStoreLive.edit(_filter); } - - // Start auto-refresh timeout timeout(); - - // Cleanup on component unmount or re-run return () => { clearTimeout(timeoutId); }; - }, [metaListLoading, filter.sort]); // Add necessary dependencies + }, [metaListLoading, filter.sort]); const refetch = () => { void searchStoreLive.fetchSessions(); @@ -172,7 +164,6 @@ function LiveSessionList() { } - // image={} show={!loading && list.length === 0} >
diff --git a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx index 8a789b97f..809d6b013 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx @@ -55,11 +55,6 @@ function SessionList() { const hasNoRecordings = !activeSite || !activeSite.recorded; const metaList = customFieldStore.list; - useEffect(() => { - if (!searchStore.urlParsed) return; - void searchStore.checkForLatestSessionCount(); - }, [location.pathname]); - const NO_CONTENT = React.useMemo(() => { if (isBookmark && !isEnterprise) { return { diff --git a/frontend/app/components/shared/SessionsTabOverview/components/SessionTags/SessionTags.tsx b/frontend/app/components/shared/SessionsTabOverview/components/SessionTags/SessionTags.tsx index 9e6bfb6b8..018e0b389 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/SessionTags/SessionTags.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/SessionTags/SessionTags.tsx @@ -25,7 +25,7 @@ function SessionTags() { const activeTab = searchStore.activeTags; React.useEffect(() => { - searchStore.toggleTag(types.ALL); + searchStore.resetTags(); }, [projectsStore.activeSiteId]) return ( diff --git a/frontend/app/mstore/searchStore.ts b/frontend/app/mstore/searchStore.ts index da92fedd6..1f2e74553 100644 --- a/frontend/app/mstore/searchStore.ts +++ b/frontend/app/mstore/searchStore.ts @@ -205,6 +205,10 @@ class SearchStore { }); } + resetTags = () => { + this.activeTags = ['all']; + } + toggleTag(tag?: iTag) { if (!tag) { this.activeTags = []; diff --git a/frontend/app/mstore/sessionStore.ts b/frontend/app/mstore/sessionStore.ts index e6c51c8e2..a0301adee 100644 --- a/frontend/app/mstore/sessionStore.ts +++ b/frontend/app/mstore/sessionStore.ts @@ -288,10 +288,7 @@ export default class SessionStore { params.order = params.order === 'asc' ? 'desc' : 'asc'; } const data: any = await sessionService.getLiveSessions(params); - this.liveSessions = data.sessions.map( - (session: any) => new Session({ ...session, live: true }), - ); - this.totalLiveSessions = data.total; + this.customSetSessions(data); } catch (e) { console.error(e); } finally { @@ -603,7 +600,9 @@ export default class SessionStore { }; customSetSessions = (data: any) => { - this.liveSessions = data.sessions.map((s: any) => new Session(s)); + this.liveSessions = data.sessions.map( + (session: any) => new Session({ ...session, live: true }), + ); this.totalLiveSessions = data.total; };