From 46e0903eefa013ae010c98d1496b94caa3ee943c Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Thu, 17 Apr 2025 13:41:59 +0200 Subject: [PATCH] ui: fix saved search applier --- .../components/SessionList/SessionList.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx index 072c2299c..080ec6262 100644 --- a/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx +++ b/frontend/app/components/shared/SessionsTabOverview/components/SessionList/SessionList.tsx @@ -10,6 +10,7 @@ import RecordingStatus from 'Shared/SessionsTabOverview/components/RecordingStat import { sessionService } from 'App/services'; import { observer } from 'mobx-react-lite'; import { useStore } from 'App/mstore'; +import { debounce } from 'App/utils' type SessionStatus = { status: number; @@ -48,10 +49,14 @@ function SessionList() { const hasNoRecordings = !activeSite || !activeSite.recorded; const metaList = customFieldStore.list; + const debouncedFetchSessions = debounce(() => { + searchStore.fetchSessions(true, isBookmark) + }, 200) + useEffect(() => { if (!searchStore.urlParsed) return; - void searchStore.fetchSessions(true, isBookmark); - }, [searchStore.urlParsed]); + debouncedFetchSessions() + }, [searchStore.urlParsed, searchStore.instance.filters, searchStore.instance.eventsOrder]); const NO_CONTENT = React.useMemo(() => {