Small tweaks to room menu

This commit is contained in:
Jon Staab
2024-12-11 13:57:46 -08:00
parent b19881a8a9
commit c83461688f
3 changed files with 15 additions and 15 deletions
+2 -1
View File
@@ -12,11 +12,12 @@ import {LEGACY_THREAD, deriveEventsForUrl, getMembershipUrls, userMembership} fr
export const checked = writable<Record<string, number>>({})
checked.subscribe(v => console.trace("======", v))
checked.subscribe(v => console.log("====== checked", v))
export const deriveChecked = (key: string) => derived(checked, prop(key))
export const setChecked = (key: string, ts = now()) =>
Boolean(console.trace("====== setChecked", key))||
checked.update(state => ({...state, [key]: ts}))
// Filters for various routes
+1 -5
View File
@@ -597,17 +597,13 @@ export const userRoomsByUrl = withGetter(
addToMapKey($userRoomsByUrl, url, room)
}
for (const url of $userRoomsByUrl.keys()) {
addToMapKey($userRoomsByUrl, url, GENERAL)
}
return $userRoomsByUrl
}),
)
export const deriveUserRooms = (url: string) =>
derived(userRoomsByUrl, $userRoomsByUrl =>
sortBy(roomComparator(url), Array.from($userRoomsByUrl.get(url) || [])),
sortBy(roomComparator(url), uniq(Array.from($userRoomsByUrl.get(url) || []).concat(GENERAL))),
)
export const deriveOtherRooms = (url: string) =>