Fixed board total count on view picker button (#10612)

This PR adds a missing call to `setRecordIndexEntityCount` during board
data loading.
This commit is contained in:
Lucas Bordeau
2025-03-03 11:25:48 +01:00
committed by GitHub
parent fddac1e250
commit c5795b7325

View File

@ -2,6 +2,7 @@ import { useRecoilCallback } from 'recoil';
import { recordGroupDefinitionFamilyState } from '@/object-record/record-group/states/recordGroupDefinitionFamilyState'; import { recordGroupDefinitionFamilyState } from '@/object-record/record-group/states/recordGroupDefinitionFamilyState';
import { recordGroupFieldMetadataComponentState } from '@/object-record/record-group/states/recordGroupFieldMetadataComponentState'; import { recordGroupFieldMetadataComponentState } from '@/object-record/record-group/states/recordGroupFieldMetadataComponentState';
import { useSetRecordIndexEntityCount } from '@/object-record/record-index/hooks/useSetRecordIndexEntityCount';
import { recordIndexRecordIdsByGroupComponentFamilyState } from '@/object-record/record-index/states/recordIndexRecordIdsByGroupComponentFamilyState'; import { recordIndexRecordIdsByGroupComponentFamilyState } from '@/object-record/record-index/states/recordIndexRecordIdsByGroupComponentFamilyState';
import { ObjectRecord } from '@/object-record/types/ObjectRecord'; import { ObjectRecord } from '@/object-record/types/ObjectRecord';
import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2'; import { useRecoilComponentCallbackStateV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackStateV2';
@ -21,6 +22,9 @@ export const useSetRecordIdsForColumn = (recordBoardId?: string) => {
recordBoardId, recordBoardId,
); );
const { setRecordIndexEntityCount } =
useSetRecordIndexEntityCount(recordBoardId);
const setRecordIdsForColumn = useRecoilCallback( const setRecordIdsForColumn = useRecoilCallback(
({ set, snapshot }) => ({ set, snapshot }) =>
(currentRecordGroupId: string, records: ObjectRecord[]) => { (currentRecordGroupId: string, records: ObjectRecord[]) => {
@ -55,9 +59,18 @@ export const useSetRecordIdsForColumn = (recordBoardId?: string) => {
recordIndexRecordIdsByGroupFamilyState(currentRecordGroupId), recordIndexRecordIdsByGroupFamilyState(currentRecordGroupId),
recordGroupRowIds, recordGroupRowIds,
); );
setRecordIndexEntityCount(
recordGroupRowIds.length,
currentRecordGroupId,
);
} }
}, },
[recordIndexRecordIdsByGroupFamilyState, recordGroupFieldMetadataState], [
recordIndexRecordIdsByGroupFamilyState,
recordGroupFieldMetadataState,
setRecordIndexEntityCount,
],
); );
return { return {