Fix squirrely notification badges
This commit is contained in:
@@ -13,12 +13,10 @@
|
||||
import {setChecked} from "@app/notifications"
|
||||
import {checkRelayConnection, checkRelayAuth, checkRelayAccess} from "@app/commands"
|
||||
import {decodeRelay} from "@app/state"
|
||||
import {deriveNotification, SPACE_FILTERS} from "@app/notifications"
|
||||
import {spacesNotifications} from "@app/notifications"
|
||||
|
||||
const url = decodeRelay($page.params.relay)
|
||||
|
||||
const notification = deriveNotification($page.url.pathname, SPACE_FILTERS, url)
|
||||
|
||||
const checkConnection = async () => {
|
||||
const connectionError = await checkRelayConnection(url)
|
||||
|
||||
@@ -35,9 +33,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
// We have to watch this one, since on mobile the badge wil be visible when active
|
||||
// We have to watch this one, since on mobile the badge will be visible when active
|
||||
$: {
|
||||
if ($notification) {
|
||||
if ($spacesNotifications.includes($page.url.pathname)) {
|
||||
setChecked($page.url.pathname)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +120,7 @@
|
||||
<Icon icon="notes-minimalistic" /> Threads
|
||||
</Link>
|
||||
{#each $userRooms as room (room)}
|
||||
<Link
|
||||
href={makeRoomPath(url, room)}
|
||||
class="btn btn-neutral">
|
||||
<Link href={makeRoomPath(url, room)} class="btn btn-neutral">
|
||||
{#if channelIsLocked($channelsById.get(makeChannelId(url, room)))}
|
||||
<Icon icon="lock" size={4} />
|
||||
{:else}
|
||||
@@ -132,9 +130,7 @@
|
||||
</Link>
|
||||
{/each}
|
||||
{#each $otherRooms as room (room)}
|
||||
<Link
|
||||
href={makeRoomPath(url, room)}
|
||||
class="btn btn-neutral">
|
||||
<Link href={makeRoomPath(url, room)} class="btn btn-neutral">
|
||||
{#if channelIsLocked($channelsById.get(makeChannelId(url, room)))}
|
||||
<Icon icon="lock" size={4} />
|
||||
{:else}
|
||||
@@ -151,7 +147,7 @@
|
||||
{#if pubkey}
|
||||
<div class="hidden flex-col gap-2" class:!flex={relayAdminEvents.length > 0}>
|
||||
<Divider>Recent posts from the relay admin</Divider>
|
||||
<ProfileFeed {url} {pubkey} bind:events={relayAdminEvents} />
|
||||
<ProfileFeed hideLoading {url} {pubkey} bind:events={relayAdminEvents} />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user