Skip to content

Commit

Permalink
Fix context store filters (#8236)
Browse files Browse the repository at this point in the history
Fix context store filters
  • Loading branch information
bosiraphael authored Oct 31, 2024
1 parent d0dc8ba commit b1e9922
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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({
Expand All @@ -103,6 +106,7 @@ export const RecordIndexTableContainerEffect = () => {
};
}, [
hasUserSelectedAllRows,
recordIndexFilters,
selectedRowIds,
setContextStoreTargetedRecords,
unselectedRowIds,
Expand Down

0 comments on commit b1e9922

Please sign in to comment.