mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 21:35:10 +00:00
Fix pinned channels double selection (#6758)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
41a228387a
commit
636d7044c5
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import activity from '@hcengineering/activity'
|
import activity from '@hcengineering/activity'
|
||||||
import core, { Class, Doc, groupByArray, reduceCalls, Ref } from '@hcengineering/core'
|
import core, { Class, Doc, groupByArray, reduceCalls, Ref, Space } from '@hcengineering/core'
|
||||||
import { DocNotifyContext } from '@hcengineering/notification'
|
import { DocNotifyContext } from '@hcengineering/notification'
|
||||||
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
@ -40,6 +40,7 @@
|
|||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
const inboxClient = InboxNotificationsClientImpl.getClient()
|
const inboxClient = InboxNotificationsClientImpl.getClient()
|
||||||
const contextsStore = inboxClient.contexts
|
const contextsStore = inboxClient.contexts
|
||||||
|
const contextByDocStore = inboxClient.contextByDoc
|
||||||
const objectsQueryByClass = new Map<Ref<Class<Doc>>, { query: LiveQuery, limit: number }>()
|
const objectsQueryByClass = new Map<Ref<Class<Doc>>, { query: LiveQuery, limit: number }>()
|
||||||
|
|
||||||
let contexts: DocNotifyContext[] = []
|
let contexts: DocNotifyContext[] = []
|
||||||
@ -69,7 +70,14 @@
|
|||||||
sections = res
|
sections = res
|
||||||
})
|
})
|
||||||
|
|
||||||
$: shouldPushObject = object !== undefined && getObjectGroup(object) === model.id
|
$: shouldPushObject =
|
||||||
|
object !== undefined &&
|
||||||
|
getObjectGroup(object) === model.id &&
|
||||||
|
(!$contextByDocStore.has(object._id) || isArchived(object))
|
||||||
|
|
||||||
|
function isArchived (object: Doc): boolean {
|
||||||
|
return hierarchy.isDerived(object._class, core.class.Space) ? (object as Space).archived : false
|
||||||
|
}
|
||||||
|
|
||||||
function loadObjects (contexts: DocNotifyContext[]): void {
|
function loadObjects (contexts: DocNotifyContext[]): void {
|
||||||
const contextsByClass = groupByArray(contexts, ({ objectClass }) => objectClass)
|
const contextsByClass = groupByArray(contexts, ({ objectClass }) => objectClass)
|
||||||
|
Loading…
Reference in New Issue
Block a user