Fix double DM context (#7835)

This commit is contained in:
Denis Bykhov 2025-01-30 08:09:40 +05:00 committed by GitHub
parent a20bd98d05
commit 80f3bbe851
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -629,24 +629,6 @@ export async function createDirect (employeeIds: Array<Ref<Employee>>): Promise<
if (context.hidden) {
await client.updateDoc(context._class, context.space, context._id, { hidden: false })
}
return dmId
}
const space = await client.findOne(
contact.class.PersonSpace,
{ person: me.person as Ref<Person> },
{ projection: { _id: 1 } }
)
if (space == null) return dmId
await client.createDoc(notification.class.DocNotifyContext, space._id, {
user: me._id,
objectId: dmId,
objectClass: chunter.class.DirectMessage,
objectSpace: core.space.Space,
hidden: false,
isPinned: false
})
return dmId
}