fix: empty state should not appear during table loading (#3040)
* fix: empty state should not appear during table loading * feat: add initla load tracking * Fix lint --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -6,6 +6,7 @@ import { useObjectNameSingularFromPlural } from '@/object-metadata/hooks/useObje
|
||||
import { turnSortsIntoOrderBy } from '@/object-record/object-sort-dropdown/utils/turnSortsIntoOrderBy';
|
||||
import { useRecordTableScopedStates } from '@/object-record/record-table/hooks/internal/useRecordTableScopedStates';
|
||||
import { useRecordTable } from '@/object-record/record-table/hooks/useRecordTable';
|
||||
import { isRecordTableInitialLoadingState } from '@/object-record/record-table/states/isRecordTableInitialLoadingState';
|
||||
import { turnFiltersIntoObjectRecordFilters } from '@/object-record/utils/turnFiltersIntoWhereClause';
|
||||
import { signInBackgroundMockCompanies } from '@/sign-in-background-mock/constants/signInBackgroundMockCompanies';
|
||||
|
||||
@ -41,6 +42,10 @@ export const useObjectRecordTable = () => {
|
||||
foundObjectMetadataItem?.fields ?? [],
|
||||
);
|
||||
|
||||
const setIsRecordTableInitialLoading = useSetRecoilState(
|
||||
isRecordTableInitialLoadingState,
|
||||
);
|
||||
|
||||
const { records, loading, fetchMoreRecords, queryStateIdentifier } =
|
||||
useFindManyRecords({
|
||||
objectNameSingular,
|
||||
@ -48,6 +53,7 @@ export const useObjectRecordTable = () => {
|
||||
orderBy,
|
||||
onCompleted: () => {
|
||||
setLastRowVisible(false);
|
||||
setIsRecordTableInitialLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user