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: hold and unhold expense page is not scrolling down #52089

Merged
merged 10 commits into from
Nov 12, 2024
10 changes: 10 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,15 @@ function isOneTransactionThread(reportID: string, parentReportID: string, thread
return reportID === transactionThreadReportID && !ReportActionsUtils.isSentMoneyReportAction(threadParentReportAction);
}

/**
* Get displayed repport ID in one transaction thread
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
*/
function getDisplayedReportID(reportID: string): string {
const report = getReport(reportID);
const parentReportAction = ReportActionsUtils.getReportAction(report?.parentReportID ?? '-1', report?.parentReportActionID ?? '-1');
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
return (isOneTransactionThread(report?.reportID ?? '', report?.parentReportID ?? '', parentReportAction) ? report?.parentReportID : reportID) ?? '';
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* Should return true only for personal 1:1 report
*
Expand Down Expand Up @@ -8553,6 +8562,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 @@ -8126,6 +8126,9 @@ function putOnHold(transactionID: string, comment: string, reportID: string, sea
},
{optimisticData, successData, failureData},
);

const currentReportID = ReportUtils.getDisplayedReportID(reportID);
Report.notifyNewAction(currentReportID ?? '', userAccountID);
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
}

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

const currentReportID = ReportUtils.getDisplayedReportID(reportID);
Report.notifyNewAction(currentReportID ?? '', userAccountID);
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
}
// eslint-disable-next-line rulesdir/no-negated-variables
function navigateToStartStepIfScanFileCannotBeRead(
Expand Down
Loading