Skip to content

Commit

Permalink
inbox warning (#489)
Browse files Browse the repository at this point in the history
* add inbox warning to the bottom of the chat history

* use getListTags
  • Loading branch information
ticruz38 authored Nov 26, 2024
1 parent 5656fad commit 56184fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/views/ChannelsDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
href={"/channels" + (isAccepted ? "" : "/requests")} />
<PersonCircles {pubkeys} />
</div>
<div class="flex flex-col items-start overflow-hidden pt-2">
<div class:h-16={pubkeys.length == 1} class="flex flex-col items-start overflow-hidden pt-2">
<div>
{#each pubkeys as pubkey, i (pubkey)}
{#if i > 0}&bullet;{/if}
Expand Down
14 changes: 12 additions & 2 deletions src/partials/Channel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -64,7 +64,7 @@
let groupedMessages = []
const pubkeysWithoutInbox = derived(inboxRelaySelectionsByPubkey, $inboxRelayPoliciesByPubkey =>
pubkeys.filter(pubkey => !$inboxRelayPoliciesByPubkey.has(pubkey)),
pubkeys.filter(pubkey => !getListTags($inboxRelayPoliciesByPubkey.get(pubkey)).length),
)
onMount(() => {
Expand Down Expand Up @@ -176,6 +176,16 @@
</div>
{/if}
</div>
{#if !userHasInbox}
<div class="m-auto max-w-96 py-20 text-center">
<div class="mb-4 text-lg text-accent">
<i class="fa fa-exclamation-triangle"></i> Your inbox is not configured.
</div>
In order to deliver messages, Coracle needs to know where to send them. Please visit your
<a class="cursor-pointer underline" href="/settings/relays"> relay settings page</a> and set
up your inbox relays.
</div>
{/if}
{#each groupedMessages as message (message.id)}
<div in:fly={{y: 20}} class="grid gap-2 py-1">
<div
Expand Down

0 comments on commit 56184fd

Please sign in to comment.