Skip to content

Commit

Permalink
Merge pull request #52089 from nkdengineer/fix/49959
Browse files Browse the repository at this point in the history
fix: hold and unhold expense page is not scrolling down
  • Loading branch information
mjasikowski authored Nov 12, 2024
2 parents 64cb4ee + 8142c68 commit e3632a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,16 @@ function isOneTransactionThread(reportID: string, parentReportID: string, thread
return reportID === transactionThreadReportID && !ReportActionsUtils.isSentMoneyReportAction(threadParentReportAction);
}

/**
* Get displayed report ID, it will be parentReportID if the report is one transaction thread
*/
function getDisplayedReportID(reportID: string): string {
const report = getReport(reportID);
const parentReportID = report?.parentReportID ?? '';
const parentReportAction = ReportActionsUtils.getReportAction(parentReportID, report?.parentReportActionID ?? '');
return isOneTransactionThread(reportID, parentReportID, parentReportAction) ? parentReportID : reportID;
}

/**
* Should return true only for personal 1:1 report
*
Expand Down Expand Up @@ -8564,6 +8574,7 @@ export {
getTaskAssigneeChatOnyxData,
getTransactionDetails,
getTransactionReportName,
getDisplayedReportID,
getTransactionsWithReceipts,
getUserDetailTooltipText,
getWhisperDisplayNames,
Expand Down
6 changes: 6 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7833,6 +7833,9 @@ function putOnHold(transactionID: string, comment: string, reportID: string, sea
},
{optimisticData, successData, failureData},
);

const currentReportID = ReportUtils.getDisplayedReportID(reportID);
Report.notifyNewAction(currentReportID, userAccountID);
}

/**
Expand Down Expand Up @@ -7932,6 +7935,9 @@ function unholdRequest(transactionID: string, reportID: string, searchHash?: num
},
{optimisticData, successData, failureData},
);

const currentReportID = ReportUtils.getDisplayedReportID(reportID);
Report.notifyNewAction(currentReportID, userAccountID);
}
// eslint-disable-next-line rulesdir/no-negated-variables
function navigateToStartStepIfScanFileCannotBeRead(
Expand Down

0 comments on commit e3632a9

Please sign in to comment.