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: LHN preview for expense report shows 0.00 when there is only one scan expense #48139

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Onyx.connect({
const transactionThreadReportID = ReportActionUtils.getOneTransactionThreadReportID(reportID, actions[reportActions[0]]);
if (transactionThreadReportID) {
const transactionThreadReportActionsArray = Object.values(actions[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`] ?? {});
sortedReportActions = ReportActionUtils.getCombinedReportActions(sortedReportActions, transactionThreadReportID, transactionThreadReportActionsArray, reportID);
sortedReportActions = ReportActionUtils.getCombinedReportActions(sortedReportActions, transactionThreadReportID, transactionThreadReportActionsArray, reportID, false);
}

lastReportActions[reportID] = sortedReportActions[0];
Expand Down
3 changes: 2 additions & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ function getCombinedReportActions(
transactionThreadReportID: string | null,
transactionThreadReportActions: ReportAction[],
reportID?: string,
shouldFilterIOUAction = true,
): ReportAction[] {
const isSentMoneyReport = reportActions.some((action) => isSentMoneyReportAction(action));

Expand Down Expand Up @@ -431,7 +432,7 @@ function getCombinedReportActions(
const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM;
// Filter out request and send money request actions because we don't want to show any preview actions for one transaction reports
const filteredReportActions = [...filteredParentReportActions, ...filteredTransactionThreadReportActions].filter((action) => {
if (!isMoneyRequestAction(action)) {
if (!isMoneyRequestAction(action) || !shouldFilterIOUAction) {
return true;
}
const actionType = getOriginalMessage(action)?.type ?? '';
Expand Down
Loading