fix: empty twitterShareUrl after creating note

This commit is contained in:
DIYgod
2023-07-25 20:17:32 +01:00
parent 798846dbbb
commit 0fde971a6d
2 changed files with 36 additions and 28 deletions
+6 -3
View File
@@ -38,9 +38,12 @@ export const getNoteSlug = (note: NoteEntity) => {
}
export const getNoteSlugFromNote = (page: ExpandedNote) => {
return page.metadata?.content?.attributes?.find(
($) => $.trait_type === "xlog_slug",
)?.value
return (
page.metadata?.content?.slug ||
page.metadata?.content?.attributes?.find(
($) => $.trait_type === "xlog_slug",
)?.value
)
}
export const getTwitterShareUrl = ({