diff --git a/src/app/components/SpaceMenu.svelte b/src/app/components/SpaceMenu.svelte index 742495e7..8029a073 100644 --- a/src/app/components/SpaceMenu.svelte +++ b/src/app/components/SpaceMenu.svelte @@ -49,6 +49,7 @@ deriveOtherRooms, deriveRoomsWithLivekit, deriveRoomsNoText, + deriveOtherVoiceRooms, userSpaceUrls, hasNip29, deriveUserCanCreateRoom, @@ -74,6 +75,7 @@ const otherRooms = deriveOtherRooms(url) const roomsWithLivekit = deriveRoomsWithLivekit(url) const roomsNoText = deriveRoomsNoText(url) + const otherVoiceRooms = deriveOtherVoiceRooms(url) const members = deriveSpaceMembers(url) const userIsAdmin = deriveUserIsSpaceAdmin(url) const reports = deriveEventsForUrl(url, [{kinds: [REPORT]}]) @@ -289,9 +291,13 @@ {#if !$roomsNoText.has(h)} {/if} - {#if $roomsWithLivekit.has(h)} - - {/if} + {/each} + {#if $otherVoiceRooms.length > 0} +
+ Voice Rooms + {/if} + {#each $otherVoiceRooms as h (h)} + {/each} {#if $canCreateRoom} diff --git a/src/app/core/state.ts b/src/app/core/state.ts index cad9bb4c..d8f13f2d 100644 --- a/src/app/core/state.ts +++ b/src/app/core/state.ts @@ -686,6 +686,22 @@ export const deriveRoomsNoText = (url: string) => return set }) +export const deriveOtherVoiceRooms = (url: string) => + derived( + [deriveRoomsWithLivekit(url), deriveUserRooms(url)], + ([$roomsWithLivekit, $userRooms]) => { + const rooms: string[] = [] + + for (const h of $roomsWithLivekit) { + if (!$userRooms.includes(h)) { + rooms.push(h) + } + } + + return sortBy(roomComparator(url), uniq(rooms)) + }, + ) + // User space/room lists export const groupListsByPubkey = deriveItemsByKey({