summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-12-21 11:23:31 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-12-21 11:23:31 +0900
commitb3ab96b5ee9e84a3393c20f917ebf7f1fa178347 (patch)
tree72ba4785241ed7fcac3c5d79f862fa4b288f8f4c /packages
parentenhance: ロールにアサインされたときの通知 (#12607) (diff)
downloadsharkey-b3ab96b5ee9e84a3393c20f917ebf7f1fa178347.tar.gz
sharkey-b3ab96b5ee9e84a3393c20f917ebf7f1fa178347.tar.bz2
sharkey-b3ab96b5ee9e84a3393c20f917ebf7f1fa178347.zip
fix(backend): ロールアサインの通知がある状態でページをリロードすると通知欄に何もでなくなる
Fix #12729
Diffstat (limited to 'packages')
-rw-r--r--packages/backend/src/core/entities/NotificationEntityService.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts
index f2124998ac..704081ed00 100644
--- a/packages/backend/src/core/entities/NotificationEntityService.ts
+++ b/packages/backend/src/core/entities/NotificationEntityService.ts
@@ -219,6 +219,8 @@ export class NotificationEntityService implements OnModuleInit {
});
}
+ const role = notification.type === 'roleAssigned' ? await this.roleEntityService.pack(notification.roleId) : undefined;
+
return await awaitAll({
id: notification.id,
createdAt: new Date(notification.createdAt).toISOString(),
@@ -229,6 +231,9 @@ export class NotificationEntityService implements OnModuleInit {
...(notification.type === 'reaction' ? {
reaction: notification.reaction,
} : {}),
+ ...(notification.type === 'roleAssigned' ? {
+ role: role,
+ } : {}),
...(notification.type === 'achievementEarned' ? {
achievement: notification.achievement,
} : {}),