diff --git a/packages/toolkit/src/view/catalog/CatalogMainView.tsx b/packages/toolkit/src/view/catalog/CatalogMainView.tsx index 38728f794..6f541e6ab 100644 --- a/packages/toolkit/src/view/catalog/CatalogMainView.tsx +++ b/packages/toolkit/src/view/catalog/CatalogMainView.tsx @@ -292,7 +292,7 @@ export const CatalogMainView = (props: CatalogViewProps) => { return () => { window.removeEventListener("hashchange", handleHashChange); }; - }, [catalogs.data, changeTab]); + }, [changeTab]); return (
diff --git a/packages/toolkit/src/view/catalog/components/tabs/CatalogMainTab.tsx b/packages/toolkit/src/view/catalog/components/tabs/CatalogMainTab.tsx index b6e2e1184..36800266b 100644 --- a/packages/toolkit/src/view/catalog/components/tabs/CatalogMainTab.tsx +++ b/packages/toolkit/src/view/catalog/components/tabs/CatalogMainTab.tsx @@ -17,7 +17,6 @@ import { InstillStore, useCreateNamespaceCatalog, useInstillStore, - useListNamespaceCatalogs, useShallow, useUpdateNamespaceCatalog, } from "../../../../lib"; @@ -66,27 +65,13 @@ export const CatalogTab = ({ const [selectedSortAnchor, setSelectedSortAnchor] = React.useState("createTime"); - const { enabledQuery, selectedNamespace } = useInstillStore( - useShallow(selector), - ); + const { selectedNamespace } = useInstillStore(useShallow(selector)); const createCatalog = useCreateNamespaceCatalog(); const updateCatalog = useUpdateNamespaceCatalog(); const isEnterprisePlan = subscription?.plan === "PLAN_ENTERPRISE"; const isTeamPlan = subscription?.plan === "PLAN_TEAM"; - const catalogState = useListNamespaceCatalogs({ - accessToken, - namespaceId: selectedNamespace ?? null, - enabled: enabledQuery && !!selectedNamespace, - }); - - React.useEffect(() => { - if (selectedNamespace) { - catalogState.refetch(); - } - }, [selectedNamespace, catalogState.refetch, catalogState]); - const handleCreateCatalogSubmit = async ( data: z.infer, ) => { @@ -104,7 +89,6 @@ export const CatalogTab = ({ payload, accessToken, }); - catalogState.refetch(); setIsCreateDialogOpen(false); } catch (error) { console.error("Error creating catalog:", error); @@ -129,7 +113,6 @@ export const CatalogTab = ({ payload, accessToken, }); - catalogState.refetch(); } catch (error) { console.error("Error updating catalog:", error); } @@ -153,7 +136,6 @@ export const CatalogTab = ({ payload: clonedCatalog, accessToken, }); - catalogState.refetch(); } catch (error) { console.error("Error cloning catalog:", error); } @@ -230,7 +212,7 @@ export const CatalogTab = ({ />
- {catalogState.isLoading ? ( + {catalogs === null || catalogs === undefined ? (
{Array.from({ length: 6 }).map((_, index) => (