From 05b5b793a5efd0f48dc61591019efebff37d6141 Mon Sep 17 00:00:00 2001 From: Corentin Mors Date: Sat, 15 Jun 2024 13:01:48 +0200 Subject: [PATCH] Fix bug when mergeRequestsToDisplay is not set yet --- src/popup/components/Content.tsx | 2 +- src/popup/components/MergeRequestItem.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/popup/components/Content.tsx b/src/popup/components/Content.tsx index 574bc31..9b36be8 100644 --- a/src/popup/components/Content.tsx +++ b/src/popup/components/Content.tsx @@ -67,7 +67,7 @@ export const Content = (props: Props) => { let mergeRequestsToDisplay = mrToDisplayByTabId[currentTab] ?? mrData.mrReceived; if (currentTab === 'to_review' && !draftInToReviewTab) { - mergeRequestsToDisplay = mergeRequestsToDisplay.filter((mr) => !mr.work_in_progress); + mergeRequestsToDisplay = mergeRequestsToDisplay?.filter((mr) => !mr.work_in_progress); } return ; diff --git a/src/popup/components/MergeRequestItem.tsx b/src/popup/components/MergeRequestItem.tsx index 42f185c..49e9b21 100644 --- a/src/popup/components/MergeRequestItem.tsx +++ b/src/popup/components/MergeRequestItem.tsx @@ -36,7 +36,7 @@ export const MergeRequestItem = ({ mr }: Props) => { approved: mr.approvals && mr.approvals.approved_by && - mr.approvals.approved_by.filter((approval) => { + mr.approvals.approved_by?.filter((approval) => { return approval.user.id === assignee.id; }).length > 0 } as UserWithApproval;