Fix group-related bugs

This commit is contained in:
Jon Staab 2024-06-21 10:38:10 -07:00
parent 2e3df2838d
commit 4708dc3013
4 changed files with 14 additions and 9 deletions

View File

@ -8,8 +8,10 @@
const meta = deriveGroupMeta(address)
</script>
<NoteContentKind1
note={{content: $meta?.about || ""}}
minLength={100}
maxLength={140}
showEntire={!truncate} />
{#key $meta?.about}
<NoteContentKind1
note={{content: $meta?.about || ""}}
minLength={100}
maxLength={140}
showEntire={!truncate} />
{/key}

View File

@ -30,10 +30,10 @@ export const readGroupMeta = (event: TrustedEvent) => {
relays: event.tags.filter(nthEq(0, 'relay')),
moderators: event.tags.filter(nthEq(0, 'p')),
identifier: meta.d,
name: meta.name,
about: meta.about,
banner: meta.banner,
image: meta.image || meta.picture,
name: meta.name || "",
about: meta.about || "",
banner: meta.banner || "",
image: meta.image || meta.picture || "",
listing_is_public: isSignedEvent(event),
} as PublishedGroupMeta
}

View File

@ -545,6 +545,7 @@ export const publishCommunityMeta = (address, identifier, meta) => {
tags: [
["d", identifier],
["name", meta.name],
["about", meta.about],
["description", meta.about],
["banner", meta.banner],
["picture", meta.image],
@ -565,6 +566,7 @@ export const publishGroupMeta = (address, identifier, meta, listPublicly) => {
["d", identifier],
["name", meta.name],
["about", meta.about],
["description", meta.description],
["banner", meta.banner],
["picture", meta.image],
["image", meta.image],

View File

@ -1848,6 +1848,7 @@ export const mention = (pubkey: string, ...args: unknown[]) => [
export const mentionGroup = (address: string, ...args: unknown[]) => [
"a",
address,
hints.WithinContext(address).getUrl(),
]