Skip to content

Commit 51eb87b

Browse files
authored
fix(app): clear viewed session notifications (#33574)
1 parent 556337d commit 51eb87b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/app/src/pages/layout-new.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
import { createEffect, Suspense, type ParentProps } from "solid-js"
2-
import { useNavigate } from "@solidjs/router"
2+
import { useNavigate, useParams } from "@solidjs/router"
33
import { DebugBar } from "@/components/debug-bar"
44
import { HelpButton } from "@/components/help-button"
55
import { Titlebar, type TitlebarUpdate } from "@/components/titlebar"
6+
import { useNotification } from "@/context/notification"
67
import { usePlatform } from "@/context/platform"
78
import { setNavigate } from "@/utils/notification-click"
89
import { setV2Toast, ToastRegion } from "@/utils/toast"
910

1011
export default function NewLayout(props: ParentProps) {
1112
const platform = usePlatform()
13+
const notification = useNotification()
1214
const navigate = useNavigate()
15+
const params = useParams<{ id?: string }>()
1316
setNavigate(navigate)
1417

1518
createEffect(() => setV2Toast(true))
19+
createEffect(() => {
20+
if (!notification.ready() || !params.id) return
21+
notification.session.markViewed(params.id)
22+
})
1623

1724
const update: TitlebarUpdate = {
1825
version: () => {

0 commit comments

Comments
 (0)