Skip to content

Commit bb2ba4f

Browse files
authored
Merge pull request Expensify#65835 from software-mansion-labs/korytko/fix-send-money-flow-check
[Avatars - Reports] Add a DM check for Send Money Flow check in avatars logic
2 parents aae9642 + 11b9c65 commit bb2ba4f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/hooks/useReportAvatarDetails.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
getPolicyName,
1111
getReportActionActorAccountID,
1212
getWorkspaceIcon,
13+
isDM,
1314
isIndividualInvoiceRoom,
1415
isInvoiceReport as isInvoiceReportUtils,
1516
isInvoiceRoom,
@@ -265,7 +266,7 @@ function useReportAvatarDetails({iouReport, report, action, ...rest}: AvatarDeta
265266
const isThereOnlyOneAttendee = new Set(attendeesIDs).size <= 1;
266267

267268
// If the action is a 'Send Money' flow, it will only have one transaction, but the person who sent the money is the child manager account, not the child owner account.
268-
const isSendMoneyFlow = action?.childMoneyRequestCount === 0 && transactions?.length === 1;
269+
const isSendMoneyFlow = action?.childMoneyRequestCount === 0 && transactions?.length === 1 && isDM(report);
269270
const singleAvatarAccountID = isSendMoneyFlow ? action.childManagerAccountID : action?.childOwnerAccountID;
270271

271272
const reportPreviewSenderID = areAmountsSignsTheSame && isThereOnlyOneAttendee ? singleAvatarAccountID : undefined;

0 commit comments

Comments
 (0)