Remove voice-only rooms from "Other rooms"

This commit is contained in:
mplorentz
2026-03-10 11:51:14 -04:00
committed by hodlbod
parent 63d9adef19
commit 298e419b02
2 changed files with 12 additions and 11 deletions
+1 -3
View File
@@ -290,9 +290,7 @@
</label>
{/if}
{#each $roomSearch.searchValues(term) as h (h)}
{#if !$roomsNoText.has(h)}
<SpaceMenuRoomItem {replaceState} {url} {h} />
{/if}
<SpaceMenuRoomItem {replaceState} {url} {h} />
{/each}
{#if $otherVoiceRooms.length > 0}
<div class="hidden md:block">
+11 -8
View File
@@ -791,17 +791,20 @@ export const deriveUserRooms = (url: string) =>
})
export const deriveOtherRooms = (url: string) =>
derived([deriveUserRooms(url), roomsByUrl], ([$userRooms, $roomsByUrl]) => {
const rooms: string[] = []
derived(
[deriveUserRooms(url), deriveRoomsNoText(url), roomsByUrl],
([$userRooms, $roomsNoText, $roomsByUrl]) => {
const rooms: string[] = []
for (const {h} of $roomsByUrl.get(url) || []) {
if (!$userRooms.includes(h)) {
rooms.push(h)
for (const {h} of $roomsByUrl.get(url) || []) {
if (!$userRooms.includes(h) && !$roomsNoText.has(h)) {
rooms.push(h)
}
}
}
return sortBy(roomComparator(url), uniq(rooms))
})
return sortBy(roomComparator(url), uniq(rooms))
},
)
// Space/room memberships