UBERF-5020: fix reply to thread (#4502)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-02-02 19:35:40 +04:00 committed by GitHub
parent c89eecc833
commit b114d142d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 11 deletions

View File

@ -286,7 +286,6 @@ export function createModel (builder: Builder): void {
hidden: false,
// component: contact.component.ContactsTabs,
locationResolver: contact.resolver.Location,
aside: chunter.component.ThreadView,
navigatorModel: {
spaces: [],
specials: [

View File

@ -148,7 +148,6 @@ export function createModel (builder: Builder): void {
icon: inventory.icon.InventoryApplication,
alias: inventoryId,
hidden: false,
aside: chunter.component.ThreadView,
navigatorModel: {
specials: [
{

View File

@ -155,7 +155,6 @@ export function createModel (builder: Builder): void {
icon: lead.icon.LeadApplication,
alias: leadId,
hidden: false,
aside: chunter.component.ThreadView,
navigatorModel: {
specials: [
{

View File

@ -302,7 +302,6 @@ export function createModel (builder: Builder): void {
locationResolver: recruit.resolver.Location,
alias: recruitId,
hidden: false,
aside: chunter.component.ThreadView,
navigatorModel: {
spaces: [],
specials: [

View File

@ -274,7 +274,6 @@ function defineApplication (
alias: trackerId,
hidden: false,
locationResolver: tracker.resolver.Location,
aside: chunter.component.ThreadView,
navigatorModel: {
specials: [
{

View File

@ -21,12 +21,19 @@ import chunter, {
chunterId,
type DirectMessage
} from '@hcengineering/chunter'
import { type Data, type Doc, type DocumentQuery, type Ref, type RelatedDocument } from '@hcengineering/core'
import {
type Data,
type Doc,
type DocumentQuery,
getCurrentAccount,
type Ref,
type RelatedDocument
} from '@hcengineering/core'
import { type IntlString, type Resources, translate } from '@hcengineering/platform'
import { MessageBox, getClient } from '@hcengineering/presentation'
import { closePanel, getCurrentLocation, getLocation, navigate, showPopup } from '@hcengineering/ui'
import activity, { type ActivityMessage, type DocUpdateMessage } from '@hcengineering/activity'
import { type DocNotifyContext, inboxId } from '@hcengineering/notification'
import notification, { type DocNotifyContext, inboxId } from '@hcengineering/notification'
import ChannelPresenter from './components/ChannelPresenter.svelte'
import ChannelView from './components/ChannelView.svelte'
@ -201,10 +208,23 @@ export async function deleteChatMessage (message: ChatMessage): Promise<void> {
export async function replyToThread (message: ActivityMessage): Promise<void> {
const loc = getCurrentLocation()
const inboxClient = InboxNotificationsClientImpl.getClient()
const context = get(inboxClient.docNotifyContextByDoc).get(message.attachedTo)
const client = getClient()
if (context === undefined) {
const inboxClient = InboxNotificationsClientImpl.getClient()
let contextId: Ref<DocNotifyContext> | undefined = get(inboxClient.docNotifyContextByDoc).get(message.attachedTo)?._id
if (contextId === undefined) {
contextId = await client.createDoc(notification.class.DocNotifyContext, message.space, {
attachedTo: message.attachedTo,
attachedToClass: message.attachedToClass,
user: getCurrentAccount()._id,
hidden: false,
lastViewedTimestamp: Date.now()
})
}
if (contextId === undefined) {
return
}
@ -212,7 +232,7 @@ export async function replyToThread (message: ActivityMessage): Promise<void> {
loc.path[2] = chunterId
}
navigateToThread(loc, context._id, message._id)
navigateToThread(loc, contextId, message._id)
}
export default async (): Promise<Resources> => ({