Skip to content
Draft
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
11 changes: 11 additions & 0 deletions src/libs/actions/IOU/ReportWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,17 @@ function getIOUReportActionWithBadge(
}
}

// A chat's hasOutstandingChildRequest flag can flip true before its REPORT_ACTIONS are hydrated locally
// (e.g. pinning a previously-hidden chat pulls it into the LHN ahead of OpenReport, see
// https://github.com/Expensify/Expensify/issues/670825). When that happens the loop above finds no
// REPORT_PREVIEW action to badge, so fall back to the chat's iouReportID directly.
if (!actionBadge && chatReport?.hasOutstandingChildRequest && chatReport?.iouReportID) {
const iouReport = getReportOrDraftReport(chatReport.iouReportID, undefined, undefined, undefined, allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${chatReport.iouReportID}`]);
if (iouReport && !isReportPendingDelete(iouReport)) {
actionBadge = getBadgeFromIOUReport(iouReport, chatReport, policy, reportMetadata, invoiceReceiverPolicy, currentUserLogin, currentUserAccountID);
}
}

return {reportAction: earliestAction, actionBadge};
}

Expand Down
Loading