diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-02-29 20:03:30 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-29 20:03:30 +0900 |
| commit | 39d6af135f43c2521bd7688fcb1c46bcce546b73 (patch) | |
| tree | aa9814915d3adaba4d92cb2454ab37550640a722 /packages/backend/src/core/NotificationService.ts | |
| parent | Update scroll.test.ts (diff) | |
| download | sharkey-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.ts | 9 |
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(); } |