Further refine notifications

This commit is contained in:
Jon Staab
2024-12-16 11:49:57 -08:00
parent 3d3ffaf406
commit fd846d41ea
5 changed files with 42 additions and 27 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
import RelayName from "@app/components/RelayName.svelte"
import RelayDescription from "@app/components/RelayDescription.svelte"
import {makeSpacePath} from "@app/routes"
import {inactiveNotifications} from "@app/notifications"
import {notifications} from "@app/notifications"
export let url
@@ -17,7 +17,7 @@
<div slot="icon"><SpaceAvatar {url} /></div>
<div slot="title" class="flex gap-1">
<RelayName {url} />
{#if $inactiveNotifications.has(path)}
{#if $notifications.has(path)}
<div class="relative top-1 h-2 w-2 rounded-full bg-primary" />
{/if}
</div>
+5 -2
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import {page} from "$app/stores"
import {goto} from "$app/navigation"
import {userProfile} from "@welshman/app"
import Avatar from "@lib/components/Avatar.svelte"
@@ -18,7 +19,7 @@
} from "@app/state"
import {pushModal} from "@app/modal"
import {makeSpacePath} from "@app/routes"
import {notifications, inactiveNotifications} from "@app/notifications"
import {notifications} from "@app/notifications"
const addSpace = () => pushModal(SpaceAdd)
@@ -32,7 +33,9 @@
$: spaceUrls = getMembershipUrls($userMembership)
$: spacePaths = spaceUrls.map(url => makeSpacePath(url))
$: anySpaceNotifications = spacePaths.some(path => $inactiveNotifications.has(path))
$: anySpaceNotifications = spacePaths.some(
path => !$page.url.pathname.startsWith(path) && $notifications.has(path),
)
</script>
<div class="relative z-nav hidden w-14 flex-shrink-0 bg-base-200 pt-4 md:block">