From 9bd57b0caa3a6c9d1a3a5a396e0578ca6404b266 Mon Sep 17 00:00:00 2001 From: mplorentz Date: Tue, 3 Mar 2026 08:44:23 -0500 Subject: [PATCH] Add loading indicator while joining --- src/app/components/VoiceRoomItem.svelte | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/app/components/VoiceRoomItem.svelte b/src/app/components/VoiceRoomItem.svelte index 7974e612..5df903d5 100644 --- a/src/app/components/VoiceRoomItem.svelte +++ b/src/app/components/VoiceRoomItem.svelte @@ -17,13 +17,18 @@ const participants = deriveVoiceParticipants(url, h) const isActive = $derived($currentVoiceSession?.url === url && $currentVoiceSession?.h === h) + let isJoining = $state(false) const handleClick = async () => { + if (isJoining) return + isJoining = true try { await joinVoiceRoom(url, h) } catch (e) { const message = e instanceof Error ? e.message : String(e) pushToast({theme: "error", message: `Failed to join voice room: ${message}`}) + } finally { + isJoining = false } } @@ -35,8 +40,15 @@
- - + + {#if isJoining} + + {:else} + + {/if} {#if $participants.length > 0}