summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NotificationService.ts
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-02-29 20:03:30 +0900
committerGitHub <noreply@github.com>2024-02-29 20:03:30 +0900
commit39d6af135f43c2521bd7688fcb1c46bcce546b73 (patch)
treeaa9814915d3adaba4d92cb2454ab37550640a722 /packages/backend/src/core/NotificationService.ts
parentUpdate scroll.test.ts (diff)
downloadsharkey-39d6af135f43c2521bd7688fcb1c46bcce546b73.tar.gz
sharkey-39d6af135f43c2521bd7688fcb1c46bcce546b73.tar.bz2
sharkey-39d6af135f43c2521bd7688fcb1c46bcce546b73.zip
enhance: 通知の履歴をリセットできるように (#13335)
* enhance: 通知の履歴をリセットできるように * Update Changelog * 通知欄も連動して更新するように * revert some changes * Update CHANGELOG.md * Remove unused part * fix
Diffstat (limited to 'packages/backend/src/core/NotificationService.ts')
-rw-r--r--packages/backend/src/core/NotificationService.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts
index af5755f88b..68ad92f396 100644
--- a/packages/backend/src/core/NotificationService.ts
+++ b/packages/backend/src/core/NotificationService.ts
@@ -215,6 +215,15 @@ export class NotificationService implements OnApplicationShutdown {
}
@bindThis
+ public async flushAllNotifications(userId: MiUser['id']) {
+ await Promise.all([
+ this.redisClient.del(`notificationTimeline:${userId}`),
+ this.redisClient.del(`latestReadNotification:${userId}`),
+ ]);
+ this.globalEventService.publishMainStream(userId, 'notificationFlushed');
+ }
+
+ @bindThis
public dispose(): void {
this.#shutdownController.abort();
}