feat: missing slug in editor
This commit is contained in:
@@ -94,9 +94,10 @@ export const expandCrossbellNote = async ({
|
||||
...new Set(expandedNote.metadata.content.images),
|
||||
]
|
||||
|
||||
if (!disableAutofill) {
|
||||
expandedNote.metadata.content.slug = getNoteSlug(expandedNote)
|
||||
}
|
||||
expandedNote.metadata.content.slug = getNoteSlug(
|
||||
expandedNote,
|
||||
disableAutofill,
|
||||
)
|
||||
if (
|
||||
!expandedNote.metadata.content.date_published &&
|
||||
expandedNote.noteId &&
|
||||
|
||||
+2
-4
@@ -27,13 +27,11 @@ export const getSiteLink = ({
|
||||
return `${IS_PROD ? "https" : "http"}://${subdomain}.${OUR_DOMAIN}`
|
||||
}
|
||||
|
||||
export const getNoteSlug = (note: NoteEntity) => {
|
||||
export const getNoteSlug = (note: NoteEntity, disableAutofill?: boolean) => {
|
||||
return encodeURIComponent(
|
||||
note.metadata?.content?.attributes?.find(
|
||||
(a) => a?.trait_type === "xlog_slug",
|
||||
)?.value ||
|
||||
note.metadata?.content?.title ||
|
||||
"",
|
||||
)?.value || (disableAutofill ? "" : note.metadata?.content?.title || ""),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user