From c7be513746d0d178e4e6e3f47814a03ea2ab54db Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 18 Jan 2022 19:34:57 -0800 Subject: [PATCH] fixing bugs on the receiving end --- components/Dashboard/Links.tsx | 2 +- components/LinkCard.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Dashboard/Links.tsx b/components/Dashboard/Links.tsx index fae5aab..6e21e43 100644 --- a/components/Dashboard/Links.tsx +++ b/components/Dashboard/Links.tsx @@ -104,7 +104,7 @@ export default function Links() { } // if I am a receiver - if (link.recipients.includes(currUser.uid)) { + if (link.recipients?.includes(currUser.uid)) { return true; } diff --git a/components/LinkCard.tsx b/components/LinkCard.tsx index 0a366bf..f41641e 100644 --- a/components/LinkCard.tsx +++ b/components/LinkCard.tsx @@ -34,6 +34,7 @@ export default function LinkCard(props: ILinkCardProps) { if (props.link.createdByUserId == currUser.uid) { sender = user; } else { + sender = teamUsersMap[props.link.createdByUserId]; } var receivers: User[] = props.link.recipients?.reduce((results, userId) => {