mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 12:35:02 +02:00
Fix email notification (#6425)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -25,7 +25,7 @@ import IconGmail from './components/icons/GmailColor.svelte'
|
||||
import Main from './components/Main.svelte'
|
||||
import NewMessages from './components/NewMessages.svelte'
|
||||
import gmail from '@hcengineering/gmail'
|
||||
import { checkHasEmail } from './utils'
|
||||
import { checkHasEmail, MessageTitleProvider } from './utils'
|
||||
|
||||
export default async (): Promise<Resources> => ({
|
||||
component: {
|
||||
@@ -40,7 +40,8 @@ export default async (): Promise<Resources> => ({
|
||||
GmailSharedMessage
|
||||
},
|
||||
function: {
|
||||
HasEmail: checkHasEmail
|
||||
HasEmail: checkHasEmail,
|
||||
MessageTitleProvider
|
||||
},
|
||||
handler: {
|
||||
DisconnectHandler: async () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import contact, {
|
||||
type PersonAccount,
|
||||
getName as getContactName
|
||||
} from '@hcengineering/contact'
|
||||
import { type Doc, type IdMap, type Ref, toIdMap } from '@hcengineering/core'
|
||||
import { type Client, type Doc, type IdMap, type Ref, toIdMap } from '@hcengineering/core'
|
||||
import { type Message, type SharedMessage } from '@hcengineering/gmail'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import gmail from './plugin'
|
||||
@@ -129,3 +129,9 @@ export function getName (
|
||||
return emp != null ? `${getContactName(h, emp)} (${emailVal})` : emailVal
|
||||
}
|
||||
}
|
||||
|
||||
export async function MessageTitleProvider (client: Client, ref: Ref<Message>, doc?: Message): Promise<string> {
|
||||
const object = doc ?? (await client.findOne(gmail.class.Message, { _id: ref }))
|
||||
|
||||
return object?.subject ?? ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user