From 2219cfe8949a27121dfdd28812810f4617507d45 Mon Sep 17 00:00:00 2001 From: mxmlnwbr Date: Mon, 18 Dec 2023 10:29:31 +0100 Subject: [PATCH] fix(app): check against all emails on multiple feedbacks --- src/components/ProposalStatusForm.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ProposalStatusForm.tsx b/src/components/ProposalStatusForm.tsx index 2c39981..e05a1d9 100644 --- a/src/components/ProposalStatusForm.tsx +++ b/src/components/ProposalStatusForm.tsx @@ -76,8 +76,9 @@ export default function ProposalStatusForm({ (proposalDetails?.typeKey === 'STUDENT' && proposalDetails?.statusKey === 'MATCHED') || (proposalDetails?.receivedFeedbacks?.length > 0 && - proposalDetails?.receivedFeedbacks?.user?.[0].userEmail === - session?.user?.email) || + proposalDetails?.receivedFeedbacks?.some( + (feedback) => feedback.userEmail === session?.user?.email + )) || providedFeedback ) { return (