Hide relay badge if no relays used

This commit is contained in:
Jon Staab 2024-03-05 10:37:04 -08:00
parent 7f80e9cbff
commit 06e6eafdb1
3 changed files with 13 additions and 8 deletions

View File

@ -263,12 +263,14 @@
{/if}
</div>
<div class="flex scale-90 items-center gap-2">
<div
class="staatliches hidden cursor-pointer rounded bg-neutral-800 px-2 text-neutral-100 transition-colors hover:bg-neutral-700 dark:bg-neutral-600 dark:hover:bg-neutral-500 sm:block"
on:click={() => setView("info")}>
<span class="text-accent">{note.seen_on.length}</span>
{pluralize(note.seen_on.length, "relay")}
</div>
{#if note.seen_on.length > 0}
<div
class="staatliches hidden cursor-pointer rounded bg-neutral-800 px-2 text-neutral-100 transition-colors hover:bg-neutral-700 dark:bg-neutral-600 dark:hover:bg-neutral-500 sm:block"
on:click={() => setView("info")}>
<span class="text-accent">{note.seen_on.length}</span>
{pluralize(note.seen_on.length, "relay")}
</div>
{/if}
<OverflowMenu {actions} />
</div>
</div>

View File

@ -293,7 +293,7 @@ export const publishGroupInvites = async (address, pubkeys, gracePeriod = 0) =>
],
})
return publishKeyShares(address, pubkeys.concat(adminKey.pubkey), template)
return publishKeyShares(address, [...pubkeys, adminKey.pubkey], template)
}
export const publishGroupEvictions = async (address, pubkeys) =>

View File

@ -44,7 +44,10 @@ export const loadGroups = async (rawAddrs: string[], relays: string[] = []) => {
if (addrs.length > 0) {
load({
relays: hints.scenario([relays]).getUrls(),
relays: hints.merge([
hints.scenario([relays]),
hints.WithinMultipleContexts(addrs),
]).getUrls(),
filters: [{kinds: [34550, 35834], authors, "#d": identifiers}],
})
}