Skip to content

Commit 905fad7

Browse files
authored
Merge pull request Expensify#60267 from thelullabyy/fix/59566-chat-preview-display-wrong-when-paying
LHN - When paying someone, chat preview shows "You" and also user name before payment info
2 parents 84fd652 + a8d2a56 commit 905fad7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libs/ReportUtils.ts

+4
Original file line numberDiff line numberDiff line change
@@ -4220,6 +4220,10 @@ function getReportPreviewMessage(
42204220
let actualPayerName = report.managerID === currentUserAccountID ? '' : getDisplayNameForParticipant({accountID: report.managerID, shouldUseShortForm: true});
42214221
actualPayerName = actualPayerName && isForListPreview && !isPreviewMessageForParentChatReport ? `${actualPayerName}:` : actualPayerName;
42224222
const payerDisplayName = isPreviewMessageForParentChatReport ? payerName : actualPayerName;
4223+
if (isForListPreview && report?.parentReportID != null) {
4224+
const payerText = isDM(parentReport) && translatePhraseKey === 'iou.payerPaidAmount' ? '' : payerDisplayName;
4225+
return translateLocal(translatePhraseKey, {amount: formattedAmount, payer: payerText});
4226+
}
42234227

42244228
return translateLocal(translatePhraseKey, {amount: formattedAmount, payer: payerDisplayName ?? ''});
42254229
}

0 commit comments

Comments
 (0)