Handle broken supported_nips

This commit is contained in:
Jon Staab
2025-05-08 11:16:02 -07:00
parent 841928783b
commit 4d10fe7cc0
3 changed files with 3 additions and 3 deletions

View File

@@ -29,7 +29,7 @@
>{displayUrl($relay.profile.contact)}</Link> >{displayUrl($relay.profile.contact)}</Link>
&bull; &bull;
{/if} {/if}
{#if $relay?.profile?.supported_nips} {#if Array.isArray($relay?.profile?.supported_nips)}
<span <span
class="tooltip cursor-pointer underline" class="tooltip cursor-pointer underline"
data-tip="NIPs supported: {$relay.profile.supported_nips.join(', ')}"> data-tip="NIPs supported: {$relay.profile.supported_nips.join(', ')}">

View File

@@ -485,7 +485,7 @@ export const messages = derived(
export const groupMeta = deriveEvents(repository, {filters: [{kinds: [GROUP_META]}]}) export const groupMeta = deriveEvents(repository, {filters: [{kinds: [GROUP_META]}]})
export const hasNip29 = (relay?: Relay) => export const hasNip29 = (relay?: Relay) =>
relay?.profile?.supported_nips?.map(String)?.includes("29") relay?.profile?.supported_nips?.map?.(String)?.includes?.("29")
// Channels // Channels

View File

@@ -112,7 +112,7 @@
<span class="ellipsize">Requires PoW {limitation?.min_pow_difficulty}</span> <span class="ellipsize">Requires PoW {limitation?.min_pow_difficulty}</span>
</p> </p>
{/if} {/if}
{#if supported_nips} {#if Array.isArray(supported_nips)}
<p class="badge badge-neutral"> <p class="badge badge-neutral">
<span class="ellipsize">NIPs: {supported_nips.join(", ")}</span> <span class="ellipsize">NIPs: {supported_nips.join(", ")}</span>
</p> </p>