(notification: Notification)
| 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 |
no test coverage detected