Move unfavorited voice rooms into a new section in the SpaceMenu
This commit is contained in:
@@ -49,6 +49,7 @@
|
|||||||
deriveOtherRooms,
|
deriveOtherRooms,
|
||||||
deriveRoomsWithLivekit,
|
deriveRoomsWithLivekit,
|
||||||
deriveRoomsNoText,
|
deriveRoomsNoText,
|
||||||
|
deriveOtherVoiceRooms,
|
||||||
userSpaceUrls,
|
userSpaceUrls,
|
||||||
hasNip29,
|
hasNip29,
|
||||||
deriveUserCanCreateRoom,
|
deriveUserCanCreateRoom,
|
||||||
@@ -74,6 +75,7 @@
|
|||||||
const otherRooms = deriveOtherRooms(url)
|
const otherRooms = deriveOtherRooms(url)
|
||||||
const roomsWithLivekit = deriveRoomsWithLivekit(url)
|
const roomsWithLivekit = deriveRoomsWithLivekit(url)
|
||||||
const roomsNoText = deriveRoomsNoText(url)
|
const roomsNoText = deriveRoomsNoText(url)
|
||||||
|
const otherVoiceRooms = deriveOtherVoiceRooms(url)
|
||||||
const members = deriveSpaceMembers(url)
|
const members = deriveSpaceMembers(url)
|
||||||
const userIsAdmin = deriveUserIsSpaceAdmin(url)
|
const userIsAdmin = deriveUserIsSpaceAdmin(url)
|
||||||
const reports = deriveEventsForUrl(url, [{kinds: [REPORT]}])
|
const reports = deriveEventsForUrl(url, [{kinds: [REPORT]}])
|
||||||
@@ -289,9 +291,13 @@
|
|||||||
{#if !$roomsNoText.has(h)}
|
{#if !$roomsNoText.has(h)}
|
||||||
<SpaceMenuRoomItem {replaceState} {url} {h} />
|
<SpaceMenuRoomItem {replaceState} {url} {h} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if $roomsWithLivekit.has(h)}
|
{/each}
|
||||||
<VoiceRoomItem {url} {h} />
|
{#if $otherVoiceRooms.length > 0}
|
||||||
{/if}
|
<div class="h-2"></div>
|
||||||
|
<SecondaryNavHeader>Voice Rooms</SecondaryNavHeader>
|
||||||
|
{/if}
|
||||||
|
{#each $otherVoiceRooms as h (h)}
|
||||||
|
<VoiceRoomItem {url} {h} />
|
||||||
{/each}
|
{/each}
|
||||||
{#if $canCreateRoom}
|
{#if $canCreateRoom}
|
||||||
<SecondaryNavItem {replaceState} onclick={addRoom}>
|
<SecondaryNavItem {replaceState} onclick={addRoom}>
|
||||||
|
|||||||
@@ -686,6 +686,22 @@ export const deriveRoomsNoText = (url: string) =>
|
|||||||
return set
|
return set
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const deriveOtherVoiceRooms = (url: string) =>
|
||||||
|
derived(
|
||||||
|
[deriveRoomsWithLivekit(url), deriveUserRooms(url)],
|
||||||
|
([$roomsWithLivekit, $userRooms]) => {
|
||||||
|
const rooms: string[] = []
|
||||||
|
|
||||||
|
for (const h of $roomsWithLivekit) {
|
||||||
|
if (!$userRooms.includes(h)) {
|
||||||
|
rooms.push(h)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sortBy(roomComparator(url), uniq(rooms))
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
// User space/room lists
|
// User space/room lists
|
||||||
|
|
||||||
export const groupListsByPubkey = deriveItemsByKey({
|
export const groupListsByPubkey = deriveItemsByKey({
|
||||||
|
|||||||
Reference in New Issue
Block a user