From 697c116956d343aeee773933b2279b91fa7e2eb8 Mon Sep 17 00:00:00 2001 From: mplorentz Date: Mon, 9 Mar 2026 11:21:50 -0400 Subject: [PATCH] Use joinAbortController as isJoining --- src/app/components/VoiceRoomItem.svelte | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/app/components/VoiceRoomItem.svelte b/src/app/components/VoiceRoomItem.svelte index e3969d0b..187e77c4 100644 --- a/src/app/components/VoiceRoomItem.svelte +++ b/src/app/components/VoiceRoomItem.svelte @@ -25,27 +25,24 @@ const participants = deriveVoiceParticipants(url, h) const isActive = $derived($currentVoiceSession?.url === url && $currentVoiceSession?.h === h) - let isJoining = $state(false) - let joinAbortController: AbortController | undefined + let joinAbortController = $state(undefined) const handleClick = async () => { if (isActive) { await leaveVoiceRoom() return } - if (isJoining) { - joinAbortController?.abort() + if (joinAbortController) { + joinAbortController.abort() return } joinAbortController = new AbortController() - isJoining = true try { await joinVoiceRoom(url, h, joinAbortController.signal) } catch (e) { console.error("Failed to join voice room", e) pushToast({theme: "error", message: "Failed to join voice room"}) } finally { - isJoining = false joinAbortController = undefined } } @@ -62,7 +59,7 @@ class={cx("!items-start", isActive && "!bg-base-100 !text-base-content")}>
- {#if isJoining} + {#if joinAbortController} {:else}