Join relay and group dynamically, dropping PUBLIC_JOINCODE

This commit is contained in:
dtonon 2026-08-13 22:54:26 +01:00
parent aaa9a0c1e5
commit 6ecd618bce
9 changed files with 453 additions and 178 deletions

View file

@ -15,9 +15,9 @@
} from "$lib/moderation.svelte";
import {
withJoin,
joinState,
membershipOf,
ensureMembershipChecked,
openJoinModal,
} from "$lib/join.svelte";
import { activeGroup } from "$lib/active.svelte";
import type { NostrUser } from "@nostr/gadgets/metadata";
@ -76,7 +76,7 @@
});
function onJoinToChat() {
openJoinModal(activeGroup.id, () => tick().then(() => inputEl?.focus()));
withJoin(activeGroup.id, () => tick().then(() => inputEl?.focus()));
}
function requestDeleteMessage(msg: ChatMessageData) {
@ -486,9 +486,10 @@
{:else if joinToChat}
<button
onclick={onJoinToChat}
class="bg-accent hover:bg-accent-hover w-full rounded px-3 py-2 text-sm font-medium text-white"
disabled={joinState.busy}
class="bg-accent hover:bg-accent-hover w-full rounded px-3 py-2 text-sm font-medium text-white disabled:opacity-50"
>
Join to chat
{joinState.busy ? "Joining…" : "Join to chat"}
</button>
{:else}
<div class="relative">