Fix table loading (#12653)

As per title
This commit is contained in:
Charles Bochet
2025-06-17 15:01:28 +02:00
committed by GitHub
parent fb9d5066dc
commit f3a8b849aa
29 changed files with 592 additions and 467 deletions

View File

@ -26,9 +26,9 @@ import { mapRecordFilterGroupToViewFilterGroup } from '@/views/utils/mapRecordFi
import { mapRecordFilterToViewFilter } from '@/views/utils/mapRecordFilterToViewFilter';
import { mapRecordSortToViewSort } from '@/views/utils/mapRecordSortToViewSort';
import { useRecoilCallback } from 'recoil';
import { isDefined } from 'twenty-shared/utils';
import { v4 } from 'uuid';
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
import { isDefined } from 'twenty-shared/utils';
export const useCreateViewFromCurrentView = (viewBarComponentId?: string) => {
const currentViewIdCallbackState = useRecoilComponentCallbackStateV2(
@ -52,7 +52,7 @@ export const useCreateViewFromCurrentView = (viewBarComponentId?: string) => {
const { objectMetadataItem } = useRecordIndexContextOrThrow();
const { findManyRecords } = useLazyFindManyRecords({
const { findManyRecordsLazy } = useLazyFindManyRecords({
objectNameSingular: CoreObjectNameSingular.View,
fetchPolicy: 'network-only',
});
@ -204,14 +204,14 @@ export const useCreateViewFromCurrentView = (viewBarComponentId?: string) => {
await createViewSortRecords(viewSortsToCreate, newView);
}
await findManyRecords();
await findManyRecordsLazy();
set(isPersistingViewFieldsState, false);
},
[
currentViewIdCallbackState,
createOneRecord,
createViewFieldRecords,
findManyRecords,
findManyRecordsLazy,
objectMetadataItem.fields,
createViewGroupRecords,
createViewSortRecords,

View File

@ -12,7 +12,7 @@ export const useRefreshCachedViews = () => {
),
});
const { findManyRecords: refreshCachedViews } = useLazyFindManyRecords({
const { findManyRecordsLazy: refreshCachedViews } = useLazyFindManyRecords({
objectNameSingular: CoreObjectNameSingular.View,
filter: findAllViewsOperationSignature.variables.filter,
recordGqlFields: findAllViewsOperationSignature.fields,