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