Skip to content

Commit 5c91b6e

Browse files
committed
refactor: simplify attendee email handling in getReportPreviewSenderID
1 parent ad14a16 commit 5c91b6e

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/components/ReportActionAvatars/useReportPreviewSenderID.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type {OnyxEntry} from 'react-native-onyx';
33
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
44
import useOnyx from '@hooks/useOnyx';
55
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
6-
import {normalizeAttendees} from '@libs/AttendeeUtils';
76
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
87
import {getAllNonDeletedTransactions} from '@libs/MoneyRequestReportUtils';
98
import {getPersonalDetailByEmail} from '@libs/PersonalDetailsUtils';
@@ -73,13 +72,7 @@ function getReportPreviewSenderID({iouReport, action, chatReport, iouActions, tr
7372
const attendeesIDs = transactions
7473
// If the transaction is a split, then attendees are not present as a property so we need to use a helper function.
7574
?.flatMap<number | undefined>((tr) =>
76-
normalizeAttendees(tr.comment?.attendees).map((att) => {
77-
if (tr.comment?.source === CONST.IOU.TYPE.SPLIT) {
78-
return getSplitAuthor(tr, splits);
79-
}
80-
81-
return att.email ? getPersonalDetailByEmail(att.email)?.accountID : undefined;
82-
}),
75+
tr.comment?.attendees?.map?.((att) => (tr.comment?.source === CONST.IOU.TYPE.SPLIT ? getSplitAuthor(tr, splits) : getPersonalDetailByEmail(att.email)?.accountID)),
8376
)
8477
.filter((accountID) => !!accountID);
8578

0 commit comments

Comments
 (0)