Skip to content

Commit

Permalink
Modified buildTransactionThread function to accept requestReportID
Browse files Browse the repository at this point in the history
  • Loading branch information
alitoshmatov committed Aug 28, 2023
1 parent 64ff471 commit 94c20d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyRequestAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function MoneyRequestAction({
// If the childReportID is not present, we need to create a new thread
const childReportID = lodashGet(action, 'childReportID', 0);
if (!childReportID) {
const thread = ReportUtils.buildTransactionThread(action);
const thread = ReportUtils.buildTransactionThread(action, requestReportID);
const userLogins = PersonalDetailsUtils.getLoginsByAccountIDs(thread.participantAccountIDs);
Report.openReport(thread.reportID, userLogins, thread, action.reportActionID);
Navigation.navigate(ROUTES.getReportRoute(thread.reportID));
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parent
*
* @returns {Object}
*/
function buildTransactionThread(reportAction) {
function buildTransactionThread(reportAction, moneyRequestReportID) {
const participantAccountIDs = _.uniq([currentUserAccountID, Number(reportAction.actorAccountID)]);
return buildOptimisticChatReport(
participantAccountIDs,
Expand All @@ -2516,7 +2516,7 @@ function buildTransactionThread(reportAction) {
undefined,
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
reportAction.reportActionID,
reportAction.reportID,
moneyRequestReportID,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default [
hideContextMenu(false);
const childReportID = lodashGet(reportAction, 'childReportID', 0);
if (!childReportID) {
const thread = ReportUtils.buildTransactionThread(reportAction);
const thread = ReportUtils.buildTransactionThread(reportAction, reportID);
const userLogins = PersonalDetailsUtils.getLoginsByAccountIDs(thread.participantAccountIDs);
Report.openReport(thread.reportID, userLogins, thread, reportAction.reportActionID);
Navigation.navigate(ROUTES.getReportRoute(thread.reportID));
Expand Down

0 comments on commit 94c20d7

Please sign in to comment.