diff --git a/src/app/components/ThreadBoardItem.svelte b/src/app/components/ThreadBoardItem.svelte index 74265a5b..7871d80f 100644 --- a/src/app/components/ThreadBoardItem.svelte +++ b/src/app/components/ThreadBoardItem.svelte @@ -3,9 +3,12 @@ import {formatTimestamp, max} from "@welshman/lib" import type {TrustedEvent} from "@welshman/util" import {COMMENT, tagSpec, tagValue} from "@welshman/util" + import {fade} from "@lib/transition" + import Link from '@lib/components/Link.svelte' import ProfileCircle from "@app/components/ProfileCircle.svelte" import ProfileName from "@app/components/ProfileName.svelte" import {deriveEventsForUrl} from "@app/repository" + import {notifications} from "@app/notifications" import {makeThreadPath} from "@app/routes" type Props = { @@ -22,15 +25,15 @@ const lastActive = $derived(max([...$replies, event].map(e => e.created_at))) const title = tagValue(tagSpec("title"), event.tags) const path = makeThreadPath(url, event.id) + const onClick = () => goto(path) + // notification={$notifications.has(path)} - const goToThread = () => goto(path) {#if mobile} - + {:else} + onclick={onClick} + class="hover:bg-surface-less cursor-pointer border-b border-solid border-line text-sm transition-colors"> + {#if $notifications.has(path)} +
+ {/if} {title || "Untitled thread"} diff --git a/src/app/notifications.ts b/src/app/notifications.ts index cf7bc9b6..55b84f4e 100644 --- a/src/app/notifications.ts +++ b/src/app/notifications.ts @@ -304,7 +304,10 @@ export const allNotifications = derived( for (const [path, {listPath, latestEvent}] of latestEventByContentPath(url, events)) { if (hasNotification(path, latestEvent)) { paths.add(path) - paths.add(listPath) + + if (hasNotification(listPath, latestEvent)) { + paths.add(listPath) + } if (hasNotification(spacePath, latestEvent)) { paths.add(spacePath)