Streamline deriveRoom

This commit is contained in:
Jon Staab
2025-10-31 16:18:58 -07:00
parent 3978e32d5f
commit b1c68972c9
6 changed files with 34 additions and 22 deletions
+3 -1
View File
@@ -98,6 +98,7 @@ import {
RelayMode,
verifyEvent,
readRoomMeta,
makeRoomMeta,
} from "@welshman/util"
import type {
TrustedEvent,
@@ -612,7 +613,8 @@ export const {
},
})
export const deriveRoom = (url: string, h: string) => _deriveRoom(makeRoomId(url, h))
export const deriveRoom = (url: string, h: string) =>
derived(_deriveRoom(makeRoomId(url, h)), $meta => $meta || makeRoomMeta({h}))
export const displayRoom = (url: string, h: string) =>
roomsById.get().get(makeRoomId(url, h))?.name || h