MCPcopy
hub / github.com/anomalyco/opencode / pruneNotifications

Function pruneNotifications

packages/app/src/context/notification.tsx:58–63  ·  view source on GitHub ↗
(list: Notification[])

Source from the content-addressed store, hash-verified

56const NOTIFICATION_TTL_MS = 1000 * 60 * 60 * 24 * 30
57
58function pruneNotifications(list: Notification[]) {
59 const cutoff = Date.now() - NOTIFICATION_TTL_MS
60 const pruned = list.filter((n) => n.time >= cutoff)
61 if (pruned.length <= MAX_NOTIFICATIONS) return pruned
62 return pruned.slice(pruned.length - MAX_NOTIFICATIONS)
63}
64
65function createNotificationIndex(): NotificationIndex {
66 return {

Callers 2

appendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected