diff --git a/src/app/notifications.ts b/src/app/notifications.ts index 84c01ee6..2c897c9b 100644 --- a/src/app/notifications.ts +++ b/src/app/notifications.ts @@ -12,11 +12,12 @@ import {LEGACY_THREAD, deriveEventsForUrl, getMembershipUrls, userMembership} fr export const checked = writable>({}) -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 diff --git a/src/app/state.ts b/src/app/state.ts index 765cbb4d..699d5510 100644 --- a/src/app/state.ts +++ b/src/app/state.ts @@ -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) => diff --git a/src/routes/spaces/[relay]/+page.svelte b/src/routes/spaces/[relay]/+page.svelte index 4108cdc4..10782242 100644 --- a/src/routes/spaces/[relay]/+page.svelte +++ b/src/routes/spaces/[relay]/+page.svelte @@ -12,6 +12,7 @@ import ChannelName from "@app/components/ChannelName.svelte" import SpaceJoin from "@app/components/SpaceJoin.svelte" import RelayName from "@app/components/RelayName.svelte" + import RoomCreate from "@app/components/RoomCreate.svelte" import RelayDescription from "@app/components/RelayDescription.svelte" import { decodeRelay, @@ -33,6 +34,8 @@ const joinSpace = () => pushModal(SpaceJoin, {url}) + const addRoom = () => pushModal(RoomCreate, {url}) + let relayAdminEvents: TrustedEvent[] = [] $: pubkey = $relay?.profile?.pubkey @@ -113,37 +116,37 @@ {/if}
- + Threads {#each $userRooms as room (room)} + class="btn btn-neutral"> {#if channelIsLocked($channelsById.get(makeChannelId(url, room)))} {:else} {/if} -
- -
+ {/each} {#each $otherRooms as room (room)} + class="btn btn-neutral"> {#if channelIsLocked($channelsById.get(makeChannelId(url, room)))} {:else} {/if} -
- -
+ {/each} +
{#if pubkey}