refactor: prune old notifications

This commit is contained in:
Catriel Müller
2026-02-20 09:36:22 -03:00
parent aa52b851fd
commit 3a0ef619ed
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -162,6 +162,7 @@
unzip
gnutar
gzip
ripgrep
kilo-dev
kilo-install-bin
kilo-bin
+6 -1
View File
@@ -905,7 +905,12 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
try {
const notifications = await this.httpClient.getNotifications()
const dismissedIds = this.extensionContext?.globalState.get<string[]>("kilo.dismissedNotificationIds", []) ?? []
const existing = this.extensionContext?.globalState.get<string[]>("kilo.dismissedNotificationIds", []) ?? []
const active = new Set(notifications.map((n) => n.id))
const dismissedIds = existing.filter((id) => active.has(id))
if (dismissedIds.length !== existing.length) {
await this.extensionContext?.globalState.update("kilo.dismissedNotificationIds", dismissedIds)
}
const message = { type: "notificationsLoaded", notifications, dismissedIds }
this.cachedNotificationsMessage = message
this.postMessage(message)