MCPcopy Index your code
hub / github.com/anomalyco/opencode / removeFromIndex

Function removeFromIndex

packages/app/src/context/notification.tsx:266–282  ·  view source on GitHub ↗
(notification: Notification)

Source from the content-addressed store, hash-verified

264 }
265
266 const removeFromIndex = (notification: Notification) => {
267 if (notification.session) {
268 setIndex("session", "all", notification.session, (all = []) => all.filter((n) => n !== notification))
269 if (!notification.viewed) {
270 const unseen = (index.session.unseen[notification.session] ?? empty).filter((n) => n !== notification)
271 updateUnseen("session", notification.session, unseen)
272 }
273 }
274
275 if (notification.directory) {
276 setIndex("project", "all", notification.directory, (all = []) => all.filter((n) => n !== notification))
277 if (!notification.viewed) {
278 const unseen = (index.project.unseen[notification.directory] ?? empty).filter((n) => n !== notification)
279 updateUnseen("project", notification.directory, unseen)
280 }
281 }
282 }
283
284 createEffect(() => {
285 if (!ready()) return

Callers 1

appendFunction · 0.85

Calls 1

updateUnseenFunction · 0.85

Tested by

no test coverage detected