diff --git a/packages/client/src/components/admin-layout/index.tsx b/packages/client/src/components/admin-layout/index.tsx index e6b1b934e..9b5294532 100644 --- a/packages/client/src/components/admin-layout/index.tsx +++ b/packages/client/src/components/admin-layout/index.tsx @@ -107,16 +107,17 @@ function LayoutWithMenu(props: LayoutWithMenuProps) { } function Content({ activeKey }) { - const { loading: collectionsLoading } = useCollectionsContext(); - const { data = {}, loading } = useRequest( + const { designable } = useDesignableSwitchContext(); + const { collections } = useCollectionsContext(); + const { data = {}, loading, run } = useRequest( `ui_schemas:getTree?filter[parentKey]=${activeKey}`, { - refreshDeps: [activeKey], + refreshDeps: [activeKey, collections, designable], formatResult: (result) => result?.data, }, ); - if (loading || collectionsLoading) { + if (loading) { return ; } diff --git a/packages/client/src/schemas/add-new/index.tsx b/packages/client/src/schemas/add-new/index.tsx index efdb46138..399ef56a8 100644 --- a/packages/client/src/schemas/add-new/index.tsx +++ b/packages/client/src/schemas/add-new/index.tsx @@ -512,7 +512,7 @@ AddNew.CardItem = observer((props: any) => { key={view.key} title={view.title} > - + {collections?.map((item) => (