From 2ecfa4c70c09c5f7d6ed67579e215537432248fd Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Sun, 7 Jan 2024 00:09:24 +0600 Subject: [PATCH] Fix_HiddenApplication_query (#4312) Signed-off-by: Denis Bykhov --- .../src/components/AppSwitcher.svelte | 15 +++++++++++---- .../src/components/Applications.svelte | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/plugins/workbench-resources/src/components/AppSwitcher.svelte b/plugins/workbench-resources/src/components/AppSwitcher.svelte index 504fdacb76..5f9307807c 100644 --- a/plugins/workbench-resources/src/components/AppSwitcher.svelte +++ b/plugins/workbench-resources/src/components/AppSwitcher.svelte @@ -19,6 +19,7 @@ import workbench from '@hcengineering/workbench' import { hideApplication, showApplication } from '../utils' import { Loading, IconCheck, Label, Icon } from '@hcengineering/ui' + import preference from '@hcengineering/preference' // import Drag from './icons/Drag.svelte' export let apps: Application[] = [] @@ -55,10 +56,16 @@ let loaded: boolean = false let hiddenAppsIds: Array> = [] const hiddenAppsIdsQuery = createQuery() - hiddenAppsIdsQuery.query(workbench.class.HiddenApplication, {}, (res) => { - hiddenAppsIds = res.map((r) => r.attachedTo) - loaded = true - }) + hiddenAppsIdsQuery.query( + workbench.class.HiddenApplication, + { + space: preference.space.Preference + }, + (res) => { + hiddenAppsIds = res.map((r) => r.attachedTo) + loaded = true + } + ) diff --git a/plugins/workbench-resources/src/components/Applications.svelte b/plugins/workbench-resources/src/components/Applications.svelte index b26100dfdb..1177680c36 100644 --- a/plugins/workbench-resources/src/components/Applications.svelte +++ b/plugins/workbench-resources/src/components/Applications.svelte @@ -20,6 +20,7 @@ import type { Application } from '@hcengineering/workbench' import workbench from '@hcengineering/workbench' import AppItem from './AppItem.svelte' + import preference from '@hcengineering/preference' export let active: Ref | undefined export let apps: Application[] = [] @@ -28,10 +29,16 @@ let loaded: boolean = false let hiddenAppsIds: Array> = [] const hiddenAppsIdsQuery = createQuery() - hiddenAppsIdsQuery.query(workbench.class.HiddenApplication, {}, (res) => { - hiddenAppsIds = res.map((r) => r.attachedTo) - loaded = true - }) + hiddenAppsIdsQuery.query( + workbench.class.HiddenApplication, + { + space: preference.space.Preference + }, + (res) => { + hiddenAppsIds = res.map((r) => r.attachedTo) + loaded = true + } + ) $: filteredApps = apps.filter((it) => !hiddenAppsIds.includes(it._id)) $: topApps = filteredApps.filter((it) => it.position === 'top')