From 2977f5067dc979152092425d8aecf42ffa048936 Mon Sep 17 00:00:00 2001 From: bosiraphael Date: Thu, 31 Oct 2024 11:37:20 +0100 Subject: [PATCH] Fix context store filters --- .../components/RecordIndexTableContainerEffect.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexTableContainerEffect.tsx b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexTableContainerEffect.tsx index a30c797f22f3..638f5f8b4943 100644 --- a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexTableContainerEffect.tsx +++ b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexTableContainerEffect.tsx @@ -7,6 +7,7 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadata import { RecordIndexRootPropsContext } from '@/object-record/record-index/contexts/RecordIndexRootPropsContext'; import { useHandleToggleColumnFilter } from '@/object-record/record-index/hooks/useHandleToggleColumnFilter'; import { useHandleToggleColumnSort } from '@/object-record/record-index/hooks/useHandleToggleColumnSort'; +import { recordIndexFiltersState } from '@/object-record/record-index/states/recordIndexFiltersState'; import { useRecordTable } from '@/object-record/record-table/hooks/useRecordTable'; import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2'; import { useSetRecordCountInCurrentView } from '@/views/hooks/useSetRecordCountInCurrentView'; @@ -81,12 +82,14 @@ export const RecordIndexTableContainerEffect = () => { const selectedRowIds = useRecoilValue(selectedRowIdsSelector()); const unselectedRowIds = useRecoilValue(unselectedRowIdsSelector()); + const recordIndexFilters = useRecoilValue(recordIndexFiltersState); + useEffect(() => { if (hasUserSelectedAllRows) { setContextStoreTargetedRecords({ mode: 'exclusion', excludedRecordIds: unselectedRowIds, - filters: [], + filters: recordIndexFilters, }); } else { setContextStoreTargetedRecords({ @@ -103,6 +106,7 @@ export const RecordIndexTableContainerEffect = () => { }; }, [ hasUserSelectedAllRows, + recordIndexFilters, selectedRowIds, setContextStoreTargetedRecords, unselectedRowIds,