mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 20:13:20 +00:00
Fix_HiddenApplication_query (#4312)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
b4089c47d4
commit
2ecfa4c70c
@ -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<Ref<Application>> = []
|
||||
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
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
|
@ -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<Application> | undefined
|
||||
export let apps: Application[] = []
|
||||
@ -28,10 +29,16 @@
|
||||
let loaded: boolean = false
|
||||
let hiddenAppsIds: Array<Ref<Application>> = []
|
||||
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')
|
||||
|
Loading…
Reference in New Issue
Block a user