Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Empty transaction data on log in #31302

Merged
merged 13 commits into from
Nov 30, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,9 @@ function getTransactionReportName(reportAction) {
}

const transaction = TransactionUtils.getLinkedTransaction(reportAction);
if (_.isEmpty(transaction)) {
return lodashGet(reportAction, ['message', 0, 'text'], '').replace(/(\r\n|\n|\r)/gm, ' ');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment to the code.

if (TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction)) {
return Localize.translateLocal('iou.receiptScanning');
}
Expand Down Expand Up @@ -2078,6 +2081,9 @@ function getReportName(report, policy = undefined) {
const parentReportAction = ReportActionsUtils.getParentReportAction(report);
if (isChatThread(report)) {
if (ReportActionsUtils.isTransactionThread(parentReportAction)) {
if (_.isEmpty(parentReportAction)) {
return Localize.translateLocal('iou.request');
}
return getTransactionReportName(parentReportAction);
}

Expand Down