forked from coracle/flotilla
Simplify and optimize notifications
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {page} from "$app/stores"
|
||||
import {remove, assoc} from "@welshman/lib"
|
||||
import {remove} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {pubkey, loadInboxRelaySelections} from "@welshman/app"
|
||||
import {fade} from "@lib/transition"
|
||||
@@ -10,7 +10,7 @@
|
||||
import ProfileCircle from "@app/components/ProfileCircle.svelte"
|
||||
import ProfileCircles from "@app/components/ProfileCircles.svelte"
|
||||
import {makeChatPath} from "@app/routes"
|
||||
import {CHAT_FILTERS, deriveNotification} from "@app/notifications"
|
||||
import {notifications} from "@app/notifications"
|
||||
|
||||
export let id: string
|
||||
export let pubkeys: string[]
|
||||
@@ -19,7 +19,6 @@
|
||||
const others = remove($pubkey!, pubkeys)
|
||||
const active = $page.params.chat === id
|
||||
const path = makeChatPath(pubkeys)
|
||||
const notification = deriveNotification(path, CHAT_FILTERS.map(assoc("authors", pubkeys)))
|
||||
|
||||
onMount(() => {
|
||||
for (const pk of others) {
|
||||
@@ -47,7 +46,7 @@
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{#if !active && $notification}
|
||||
{#if !active && $notifications.has(path)}
|
||||
<div class="h-2 w-2 rounded-full bg-primary" transition:fade />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user