Skip to content

Commit

Permalink
fix: empty metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Nov 25, 2024
1 parent a0ff7f0 commit 976a5cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/expand-unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ export const expandCrossbellNote = async ({
}

export const expandCrossbellCharacter = async (site: CharacterEntity) => {
if (!site.metadata && site.uri) {
site.metadata = {
uri: site.uri,
}
}
if (site.metadata?.uri && !site.metadata?.content) {
site.metadata.content = await (
await fetch(toGateway(site.metadata.uri))
Expand All @@ -258,6 +263,11 @@ export const expandCrossbellCharacter = async (site: CharacterEntity) => {
},
site,
)
if (!expandedCharacter.metadata) {
expandedCharacter.metadata = {
content: {},
}
}
if (!expandedCharacter.metadata.content) {
expandedCharacter.metadata.content = {}
}
Expand Down

0 comments on commit 976a5cd

Please sign in to comment.