diff --git a/plugins/view-resources/src/components/list/ListCategories.svelte b/plugins/view-resources/src/components/list/ListCategories.svelte index 11abc4a660..0e9098d2fc 100644 --- a/plugins/view-resources/src/components/list/ListCategories.svelte +++ b/plugins/view-resources/src/components/list/ListCategories.svelte @@ -52,6 +52,9 @@ let categories: any[] = [] $: updateCategories(_class, docs, groupByKey, viewOptions, viewOptionsConfig) + const client = getClient() + const hierarchy = client.getHierarchy() + const queryId = generateId() onDestroy(() => { CategoryQuery.remove(queryId) @@ -75,7 +78,7 @@ const categoryFunc = viewOption as CategoryOption if (viewOptions[viewOption.key] ?? viewOption.defaultValue) { const f = await getResource(categoryFunc.action) - const res = await f(_class, space, groupByKey, update, queryId) + const res = hierarchy.clone(await f(_class, space, groupByKey, update, queryId)) if (res !== undefined) { for (const category of categories) { if (!res.includes(category)) { @@ -90,8 +93,6 @@ } } - const client = getClient() - let itemModels: AttributeModel[] function getHeader (_class: Ref>, groupByKey: string): void {