UBERF-6189 Fix document inbox issues (#5072)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2024-03-27 17:28:43 +07:00
committed by GitHub
parent 183239f2fe
commit 7b4db2e94d
5 changed files with 22 additions and 4 deletions
+6
View File
@@ -15,6 +15,7 @@
import {
type AttachedData,
type Client,
type Ref,
type TxOperations,
getCollaborativeDoc,
@@ -138,3 +139,8 @@ function parseDocumentId (shortLink: string): Ref<Document> | undefined {
}
return undefined
}
export async function documentTitleProvider (client: Client, ref: Ref<Document>, doc?: Document): Promise<string> {
const object = doc ?? (await client.findOne(document.class.Document, { _id: ref }))
return object?.name ?? ''
}