From 5394e0bc50c2deb7148952644c36e3bb827e5f7d Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 20 Mar 2022 20:52:54 +0200 Subject: [PATCH] Temp fix logged in user missing discordName --- app/components/Chat/Message.tsx | 5 ++++- app/components/Chat/index.tsx | 3 ++- app/routes/chat.ts | 4 +++- app/utils/schemas.ts | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/components/Chat/Message.tsx b/app/components/Chat/Message.tsx index bc6cbe2f6..f8aa6dae4 100644 --- a/app/components/Chat/Message.tsx +++ b/app/components/Chat/Message.tsx @@ -14,7 +14,10 @@ export function Message({ return (
  • -
    {data.sender.discordName}
    +
    + {/* TODO: */} + {data.sender.discordName ?? ""} +
    {userInfo && (
    {userInfo}
    )} diff --git a/app/components/Chat/index.tsx b/app/components/Chat/index.tsx index 99ac9209d..a2793cc7a 100644 --- a/app/components/Chat/index.tsx +++ b/app/components/Chat/index.tsx @@ -47,7 +47,8 @@ export function Chat({ content: sentMessage, sender: { id: user.id, - discordName: user.discordName, + // TODO: + discordName: user.discordName!, }, }} userInfo={userInfos[user.id]} diff --git a/app/routes/chat.ts b/app/routes/chat.ts index 3e17a9c15..97e0f4ed4 100644 --- a/app/routes/chat.ts +++ b/app/routes/chat.ts @@ -39,7 +39,9 @@ export const action: ActionFunction = async ({ request, context }) => { roomId: messageFromDb.roomId, sender: { id: user.id, - discordName: user.discordName, + // TODO: fix + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + discordName: user.discordName!, }, }; diff --git a/app/utils/schemas.ts b/app/utils/schemas.ts index c525f72d3..31bf31056 100644 --- a/app/utils/schemas.ts +++ b/app/utils/schemas.ts @@ -27,7 +27,8 @@ export const LoggedInUserSchema = z id: z.string(), discordId: z.string(), discordAvatar: z.string().nullable(), - discordName: z.string(), + // TODO: fix + discordName: z.string().nullish(), }) .nullish(), })