forked from nostr/nostrweb
profile: fix displaying website metadata
was using the wrong key and did not update
parent
f9fc0162ff
commit
a2cf5c90b9
|
@ -37,7 +37,7 @@ const transformMetadata = (data: unknown): Profile | undefined => {
|
||||||
name,
|
name,
|
||||||
...(hasAboutString && {about: data.about as string}),
|
...(hasAboutString && {about: data.about as string}),
|
||||||
...(hasPictureString && {picture: data.picture as string}),
|
...(hasPictureString && {picture: data.picture as string}),
|
||||||
...(hasWebsite && {hasWebsite: data.website as string})
|
...(hasWebsite && {website: data.website as string})
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -126,4 +126,15 @@ export const renderProfile = (pubkey: string) => {
|
||||||
detail?.append(...content);
|
detail?.append(...content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (metadata.website) {
|
||||||
|
const website = detail.querySelector('[data-website]');
|
||||||
|
if (website) {
|
||||||
|
const url = metadata.website.toLowerCase().startsWith('http') ? metadata.website : `https://${metadata.website}`;
|
||||||
|
const [content] = parseTextContent(url);
|
||||||
|
website.replaceChildren(...content);
|
||||||
|
(website as HTMLDivElement).hidden = false;
|
||||||
|
} else {
|
||||||
|
detail.append(elem('div', {data: {website: ''}}, metadata.name));
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue