diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2023-11-01 13:34:05 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-01 13:34:05 +0900 |
| commit | 5fb6847419ba75edc33270071f4990244669e262 (patch) | |
| tree | 84e82db8636ca4c6b2abbe1fba254dc461215230 /packages/backend/src/core/NotificationService.ts | |
| parent | enhance(frontend): 「内容を隠す」でリアクションも隠れるよ... (diff) | |
| download | sharkey-5fb6847419ba75edc33270071f4990244669e262.tar.gz sharkey-5fb6847419ba75edc33270071f4990244669e262.tar.bz2 sharkey-5fb6847419ba75edc33270071f4990244669e262.zip | |
Feat: 未読通知数を表示できるように (#11982)
* 未読通知数を表示できるように
* Update Changelog
* オプトインにする
* Fix lint
* (add) テスト通知のプッシュ通知を追加
* add test
* フロントエンドの表示上限を99に変更
* Make it default on
* 共通スタイルをくくりだす
* Update Changelog
* tweak
* Update UserEntityService.ts
* rename
* Update navbar-for-mobile.vue
---------
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/backend/src/core/NotificationService.ts')
| -rw-r--r-- | packages/backend/src/core/NotificationService.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts index c6d5023e65..7c3672c67a 100644 --- a/packages/backend/src/core/NotificationService.ts +++ b/packages/backend/src/core/NotificationService.ts @@ -144,7 +144,9 @@ export class NotificationService implements OnApplicationShutdown { this.globalEventService.publishMainStream(notifieeId, 'notification', packed); // 2秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する - setTimeout(2000, 'unread notification', { signal: this.#shutdownController.signal }).then(async () => { + // テスト通知の場合は即時発行 + const interval = notification.type === 'test' ? 0 : 2000; + setTimeout(interval, 'unread notification', { signal: this.#shutdownController.signal }).then(async () => { const latestReadNotificationId = await this.redisClient.get(`latestReadNotification:${notifieeId}`); if (latestReadNotificationId && (latestReadNotificationId >= (await redisIdPromise)!)) return; |