From 4fa9e18920a6c4b4fb582a6465192c42ccd64d2d Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Wed, 17 Jan 2024 15:59:55 +0100 Subject: [PATCH] Fixed selection reset on loading more (#3500) --- .../hooks/internal/useSetRecordTableData.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.ts b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.ts index f19434291..dbf439e58 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.ts +++ b/packages/twenty-front/src/modules/object-record/record-table/hooks/internal/useSetRecordTableData.ts @@ -2,7 +2,6 @@ import { useRecoilCallback } from 'recoil'; import { entityFieldsFamilyState } from '@/object-record/field/states/entityFieldsFamilyState'; import { useRecordTableStates } from '@/object-record/record-table/hooks/internal/useRecordTableStates'; -import { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection'; import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue'; import { isDeeplyEqual } from '~/utils/isDeeplyEqual'; @@ -15,8 +14,6 @@ export const useSetRecordTableData = ({ recordTableId, onEntityCountChange, }: useSetRecordTableDataProps) => { - const resetTableRowSelection = useResetTableRowSelection(recordTableId); - const { getTableRowIdsState, getNumberOfTableRowsState } = useRecordTableStates(recordTableId); @@ -41,16 +38,9 @@ export const useSetRecordTableData = ({ set(getTableRowIdsState(), entityIds); } - resetTableRowSelection(); - set(getNumberOfTableRowsState(), entityIds.length); onEntityCountChange(entityIds.length); }, - [ - getNumberOfTableRowsState, - getTableRowIdsState, - onEntityCountChange, - resetTableRowSelection, - ], + [getNumberOfTableRowsState, getTableRowIdsState, onEntityCountChange], ); };