MCPcopy Create free account
hub / github.com/anomalyco/opencode / markViewed

Function markViewed

packages/app/src/context/notification.tsx:419–436  ·  view source on GitHub ↗
(session: string)

Source from the content-addressed store, hash-verified

417 return index.session.unseenHasError[session] ?? false
418 },
419 markViewed(session: string) {
420 const unseen = index.session.unseen[session] ?? empty
421 if (!unseen.length) return
422
423 const projects = [
424 ...new Set(unseen.flatMap((notification) => (notification.directory ? [notification.directory] : []))),
425 ]
426 batch(() => {
427 setStore("list", (n) => n.session === session && !n.viewed, "viewed", true)
428 updateUnseen("session", session, [])
429 projects.forEach((directory) => {
430 const next = (index.project.unseen[directory] ?? empty).filter(
431 (notification) => notification.session !== session,
432 )
433 updateUnseen("project", directory, next)
434 })
435 })
436 },
437 },
438 project: {
439 all(directory: string) {

Callers

nothing calls this directly

Calls 3

batchFunction · 0.85
setStoreFunction · 0.85
updateUnseenFunction · 0.85

Tested by

no test coverage detected