mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 05:07:43 +02:00
[Part 2]: Sidebar and chat fixes (#6656)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
import view, { decodeObjectURI } from '@hcengineering/view'
|
||||
import { parseLinkId } from '@hcengineering/view-resources'
|
||||
import { get } from 'svelte/store'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
|
||||
import { InboxNotificationsClientImpl } from '../../inboxNotificationsClient'
|
||||
import notification from '../../plugin'
|
||||
@@ -179,6 +180,12 @@
|
||||
}
|
||||
|
||||
const selectedMessageId = loc?.loc.query?.message as Ref<ActivityMessage> | undefined
|
||||
const thread = loc?.loc.path[4] as Ref<ActivityMessage> | undefined
|
||||
|
||||
if (thread !== undefined) {
|
||||
const fn = await getResource(chunter.function.OpenThreadInSidebar)
|
||||
void fn(thread)
|
||||
}
|
||||
|
||||
if (selectedMessageId !== undefined) {
|
||||
selectedMessage = get(inboxClient.activityInboxNotifications).find(
|
||||
|
||||
@@ -588,6 +588,7 @@ export async function selectInboxContext (
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
const { objectId, objectClass } = context
|
||||
const loc = getCurrentLocation()
|
||||
|
||||
if (isMentionNotification(notification) && isActivityMessageClass(notification.mentionedInClass)) {
|
||||
const selectedMsg = notification.mentionedIn as Ref<ActivityMessage>
|
||||
@@ -619,17 +620,25 @@ export async function selectInboxContext (
|
||||
}
|
||||
|
||||
if (isReactionMessage(message)) {
|
||||
void navigateToInboxDoc(linkProviders, objectId, objectClass, undefined, objectId as Ref<ActivityMessage>)
|
||||
const thread = loc.path[4] === objectId ? objectId : undefined
|
||||
void navigateToInboxDoc(
|
||||
linkProviders,
|
||||
objectId,
|
||||
objectClass,
|
||||
thread as Ref<ActivityMessage>,
|
||||
objectId as Ref<ActivityMessage>
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const selectedMsg = (notification as ActivityInboxNotification)?.attachedTo
|
||||
const thread = selectedMsg !== objectId ? objectId : loc.path[4] === objectId ? objectId : undefined
|
||||
|
||||
void navigateToInboxDoc(
|
||||
linkProviders,
|
||||
objectId,
|
||||
objectClass,
|
||||
selectedMsg !== undefined ? (objectId as Ref<ActivityMessage>) : undefined,
|
||||
thread as Ref<ActivityMessage>,
|
||||
selectedMsg ?? (objectId as Ref<ActivityMessage>)
|
||||
)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user