From 45796596cb9c60e47f915540a701d45d76e56670 Mon Sep 17 00:00:00 2001 From: Ticruz Date: Mon, 25 Nov 2024 17:11:53 +0100 Subject: [PATCH 1/2] add inbox warning to the bottom of the chat history --- src/app/views/ChannelsDetail.svelte | 2 +- src/partials/Channel.svelte | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/app/views/ChannelsDetail.svelte b/src/app/views/ChannelsDetail.svelte index 86044de14..a40892631 100644 --- a/src/app/views/ChannelsDetail.svelte +++ b/src/app/views/ChannelsDetail.svelte @@ -61,7 +61,7 @@ href={"/channels" + (isAccepted ? "" : "/requests")} /> -
+
{#each pubkeys as pubkey, i (pubkey)} {#if i > 0}•{/if} diff --git a/src/partials/Channel.svelte b/src/partials/Channel.svelte index 318b8e4ce..9c0f02089 100644 --- a/src/partials/Channel.svelte +++ b/src/partials/Channel.svelte @@ -64,7 +64,11 @@ let groupedMessages = [] const pubkeysWithoutInbox = derived(inboxRelaySelectionsByPubkey, $inboxRelayPoliciesByPubkey => - pubkeys.filter(pubkey => !$inboxRelayPoliciesByPubkey.has(pubkey)), + pubkeys.filter( + pubkey => + !$inboxRelayPoliciesByPubkey.has(pubkey) || + !$inboxRelayPoliciesByPubkey.get(pubkey).publicTags.length, + ), ) onMount(() => { @@ -176,6 +180,16 @@
{/if}
+ {#if !userHasInbox} +
+
+ Your inbox is not configured. +
+ In order to deliver messages, Coracle needs to know where to send them. Please visit your + relay settings page and set + up your inbox relays. +
+ {/if} {#each groupedMessages as message (message.id)}
Date: Tue, 26 Nov 2024 12:27:12 +0100 Subject: [PATCH 2/2] use getListTags --- src/partials/Channel.svelte | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/partials/Channel.svelte b/src/partials/Channel.svelte index 9c0f02089..da90e2c4f 100644 --- a/src/partials/Channel.svelte +++ b/src/partials/Channel.svelte @@ -4,7 +4,7 @@ import {pluralize} from "hurdak" import {derived} from "svelte/store" import {sleep} from "@welshman/lib" - import type {TrustedEvent} from "@welshman/util" + import {getListTags, type TrustedEvent} from "@welshman/util" import {Nip46Signer} from "@welshman/signer" import { session, @@ -64,11 +64,7 @@ let groupedMessages = [] const pubkeysWithoutInbox = derived(inboxRelaySelectionsByPubkey, $inboxRelayPoliciesByPubkey => - pubkeys.filter( - pubkey => - !$inboxRelayPoliciesByPubkey.has(pubkey) || - !$inboxRelayPoliciesByPubkey.get(pubkey).publicTags.length, - ), + pubkeys.filter(pubkey => !getListTags($inboxRelayPoliciesByPubkey.get(pubkey)).length), ) onMount(() => {