Fix duplication of views (#8450)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2025-04-03 14:57:15 +07:00
committed by GitHub
parent a4166b220d
commit cacb6036ee
3 changed files with 22 additions and 5 deletions
@@ -17,7 +17,7 @@
import { MasterTag } from '@hcengineering/card'
import { WithLookup } from '@hcengineering/core'
import { createQuery, getClient } from '@hcengineering/presentation'
import { createQuery } from '@hcengineering/presentation'
import setting from '@hcengineering/setting'
import { clearSettingsStore, settingsStore } from '@hcengineering/setting-resources'
import { ButtonIcon, Icon, IconAdd, Label, showPopup } from '@hcengineering/ui'
@@ -29,14 +29,12 @@
export let masterTag: MasterTag
let viewlets: WithLookup<Viewlet>[] = []
const client = getClient()
const hierarchy = client.getHierarchy()
const query = createQuery()
$: query.query(
view.class.Viewlet,
{ attachTo: { $in: hierarchy.getDescendants(masterTag._id) } },
{ attachTo: masterTag._id, variant: { $exists: false } },
(res) => {
viewlets = res
},