Use userRoomsByUrl
This commit is contained in:
@@ -22,8 +22,7 @@
|
||||
channelsById,
|
||||
deriveUserRooms,
|
||||
deriveOtherRooms,
|
||||
userMembership,
|
||||
getMembershipUrls,
|
||||
userRoomsByUrl,
|
||||
} from "@app/state"
|
||||
import {makeChatPath, makeRoomPath, makeSpacePath} from "@app/routes"
|
||||
import {notifications} from "@app/notifications"
|
||||
@@ -51,7 +50,7 @@
|
||||
</div>
|
||||
<strong slot="title">Home</strong>
|
||||
<div slot="action" class="row-2">
|
||||
{#if !getMembershipUrls($userMembership).includes(url)}
|
||||
{#if !$userRoomsByUrl.has(url)}
|
||||
<Button class="btn btn-primary btn-sm" on:click={joinSpace}>
|
||||
<Icon icon="login-2" />
|
||||
Join Space
|
||||
|
||||
@@ -24,13 +24,12 @@
|
||||
import ChannelCompose from "@app/components/ChannelCompose.svelte"
|
||||
import {
|
||||
userSettingValues,
|
||||
userMembership,
|
||||
decodeRelay,
|
||||
deriveEventsForUrl,
|
||||
GENERAL,
|
||||
tagRoom,
|
||||
LEGACY_MESSAGE,
|
||||
getMembershipRoomsByUrl,
|
||||
userRoomsByUrl,
|
||||
displayChannel,
|
||||
} from "@app/state"
|
||||
import {setChecked} from "@app/notifications"
|
||||
@@ -160,7 +159,7 @@
|
||||
</strong>
|
||||
<div slot="action" class="row-2">
|
||||
{#if room !== GENERAL}
|
||||
{#if getMembershipRoomsByUrl(url, $userMembership).includes(room)}
|
||||
{#if $userRoomsByUrl.get(url)?.has(room)}
|
||||
<Button class="btn btn-neutral btn-sm" on:click={leaveRoom}>
|
||||
<Icon icon="arrows-a-logout-2" />
|
||||
Leave Room
|
||||
|
||||
Reference in New Issue
Block a user