Skip to content

Commit

Permalink
Merge pull request #26823 from StevenKKC/fixSubtitleinIOUHeader
Browse files Browse the repository at this point in the history
fix no subtitle in IOU header when offline
  • Loading branch information
NikkiWines authored Sep 11, 2023
2 parents 3a3c844 + e673777 commit 053290d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@ function buildOptimisticIOUReport(payeeAccountID, payerAccountID, total, chatRep

// We don't translate reportName because the server response is always in English
reportName: `${payerEmail} owes ${formattedTotal}`,
parentReportID: chatReportID,
};
}

Expand Down Expand Up @@ -1991,6 +1992,7 @@ function buildOptimisticExpenseReport(chatReportID, policyID, payeeAccountID, to
state: CONST.REPORT.STATE.SUBMITTED,
stateNum: CONST.REPORT.STATE_NUM.PROCESSING,
total: storedTotal,
parentReportID: chatReportID,
};
}

Expand Down
4 changes: 4 additions & 0 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ function getMoneyRequestInformation(
reportPreviewAction = ReportUtils.updateReportPreview(iouReport, reportPreviewAction, comment, optimisticTransaction);
} else {
reportPreviewAction = ReportUtils.buildOptimisticReportPreview(chatReport, iouReport, comment, optimisticTransaction);

// Generated ReportPreview action is a parent report action of the iou report.
// We are setting the iou report's parentReportActionID to display subtitle correctly in IOU page when offline.
iouReport.parentReportActionID = reportPreviewAction.reportActionID;
}

// Add optimistic personal details for participant
Expand Down

0 comments on commit 053290d

Please sign in to comment.