From f24f4c3b76904419fc9433f37bbb8d35ef3db817 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 12 Jun 2024 22:06:42 +0100 Subject: [PATCH] remove outdated condition + fix lint --- src/components/ReportWelcomeText.tsx | 2 +- src/libs/ReportUtils.ts | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 7972164701e0..a5c46b82d94a 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -1,7 +1,7 @@ import React, {useMemo} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; -import {useOnyx, withOnyx} from 'react-native-onyx'; +import {withOnyx} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 65998c8641f4..d8c2c60682e2 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1617,13 +1617,7 @@ function getReportRecipientAccountIDs(report: OnyxEntry, currentLoginAcc } let finalParticipantAccountIDs: number[] = []; - if (isMoneyRequestReport(report)) { - // For money requests i.e the IOU (1:1 person) and Expense (1:* person) reports, use the full `participants` - // and add the `ownerAccountId`. Money request reports don't add `ownerAccountId` in `participants` array - const defaultParticipantAccountIDs = Object.keys(finalReport?.participants ?? {}).map(Number); - const setOfParticipantAccountIDs = new Set(report?.ownerAccountID ? [...defaultParticipantAccountIDs, report.ownerAccountID] : defaultParticipantAccountIDs); - finalParticipantAccountIDs = [...setOfParticipantAccountIDs]; - } else if (isTaskReport(report)) { + if (isTaskReport(report)) { // Task reports `managerID` will change when assignee is changed, in that case the old `managerID` is still present in `participants` // along with the new one. We only need the `managerID` as a participant here. finalParticipantAccountIDs = report?.managerID ? [report?.managerID] : [];