From 3f2a795229d54c3e2879eec2334daea2aa638ec7 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sun, 24 Apr 2022 15:34:58 +0100 Subject: [PATCH] fix: Place notifBody inside a body prop The previous behaviour has issues with typescript expanding types. This implementation does not, so we're gonna roll with that instead. --- common/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/types.ts b/common/src/types.ts index 1f9d119d6..24ff8a9d8 100644 --- a/common/src/types.ts +++ b/common/src/types.ts @@ -1500,7 +1500,7 @@ interface BaseNotification { read: boolean; } -export type NotificationTypes = +export type NotificationBody = | { // Emitted when the user is rivalled by someone. type: "RIVALED_BY"; @@ -1518,4 +1518,4 @@ export type NotificationTypes = }; }; -export type NotificationDocument = BaseNotification & NotificationTypes; +export type NotificationDocument = BaseNotification & { body: NotificationBody };