Make voice rooms in sidebar reactive

This commit is contained in:
mplorentz
2026-03-02 17:49:13 -05:00
committed by hodlbod
parent 108a9fef06
commit de76cfd208
2 changed files with 30 additions and 6 deletions
+22
View File
@@ -663,6 +663,28 @@ export const displayRoom = (url: string, h: string) => getRoom(makeRoomId(url, h
export const roomComparator = (url: string) => (h: string) => displayRoom(url, h).toLowerCase()
export const deriveRoomsWithLivekit = (url: string) =>
derived(roomsById, $roomsById => {
const set = new Set<string>()
for (const room of $roomsById.values()) {
if (room.url === url && room.event?.tags?.some(t => t[0] === "livekit")) {
set.add(room.h)
}
}
return set
})
export const deriveRoomsNoText = (url: string) =>
derived(roomsById, $roomsById => {
const set = new Set<string>()
for (const room of $roomsById.values()) {
if (room.url === url && room.event?.tags?.some(t => t[0] === "no-text")) {
set.add(room.h)
}
}
return set
})
export const roomHasLivekit = (url: string, h: string) => {
const room = getRoom(makeRoomId(url, h))
return room?.event?.tags?.some(t => t[0] === "livekit") ?? false