fix: undefined notification url path

This commit is contained in:
DIYgod 2023-02-08 17:46:40 +00:00
parent e81c40e252
commit c5dafe9d87
No known key found for this signature in database
1 changed files with 16 additions and 9 deletions

View File

@ -13,19 +13,26 @@ export const urlComposer: Partial<UrlComposer> = {
}
if (originalNote.metadata?.content?.sources?.includes("xlog")) {
const { character } = originalNote
if (character) {
if (originalNote.metadata?.content?.external_urls?.[0]) {
return (
getSiteLink({
subdomain: character.handle,
}) +
"/" +
getNoteSlug(originalNote) +
originalNote.metadata.content.external_urls[0] +
(originalNote !== note ? `#comments` : "")
)
} else {
return ""
const { character } = originalNote
if (character) {
return (
getSiteLink({
subdomain: character.handle,
}) +
"/" +
getNoteSlug(originalNote) +
(originalNote !== note ? `#comments` : "")
)
} else {
return ""
}
}
} else {
return `${CSB_IO}/notes/${note.characterId}-${note.noteId}`