fix: entity types query keepPreviousData (#20476)

This commit is contained in:
Alaister Young authored and GitHub committed 2024-01-16 23:06:22 +11:00
1 parent 8e5b289fcf
commit 4bf421c5c3
3 files changed
+14 -22

No files matched your search

@@ -36,16 +36,13 @@ const CreateIndexSidePanel = ({ visible, onClose }: CreateIndexSidePanelProps) =
projectRef: project?.ref,
connectionString: project?.connectionString,
})
const { data: entities } = useEntityTypesQuery(
{
schema: selectedSchema,
sort: 'alphabetical',
search: undefined,
projectRef: project?.ref,
connectionString: project?.connectionString,
},
{ keepPreviousData: true }
)
const { data: entities } = useEntityTypesQuery({
schema: selectedSchema,
sort: 'alphabetical',
search: undefined,
projectRef: project?.ref,
connectionString: project?.connectionString,
})
const {
data: tableColumns,
isLoading: isLoadingTableColumns,
@@ -21,17 +21,12 @@ const EmptyState = ({}: EmptyStateProps) => {
)
const { project } = useProjectContext()
const { data } = useEntityTypesQuery(
{
projectRef: project?.ref,
connectionString: project?.connectionString,
schema: snap.selectedSchemaName,
sort,
},
{
keepPreviousData: true,
}
)
const { data } = useEntityTypesQuery({
projectRef: project?.ref,
connectionString: project?.connectionString,
schema: snap.selectedSchemaName,
sort,
})
const totalCount = data?.pages?.[0].data.count ?? 0
@@ -70,7 +70,7 @@ const TableEditorMenu = () => {
sort,
},
{
keepPreviousData: true,
keepPreviousData: Boolean(searchText),
}
)