diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 9b42a0925680..1d0f676e4116 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1183,6 +1183,17 @@ function getDisplayNamesWithTooltips(personalDetailsList, isMultipleParticipantR }); } +/** + * Get the report given a reportID + * + * @param {String} reportID + * @returns {Object} + */ +function getReport(reportID) { + // Deleted reports are set to null and lodashGet will still return null in that case, so we need to add an extra check + return lodashGet(allReports, `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {}) || {}; +} + /** * Determines if a report has an IOU that is waiting for an action from the current user (either Pay or Add a credit bank account) * @@ -1194,6 +1205,10 @@ function isWaitingForIOUActionFromCurrentUser(report) { return false; } + if (isArchivedRoom(getReport(report.parentReportID))) { + return false; + } + const policy = getPolicy(report.policyID); if (policy.type === CONST.POLICY.TYPE.CORPORATE) { // If the report is already settled, there's no action required from any user. @@ -1311,17 +1326,6 @@ function getMoneyRequestReportName(report, policy = undefined) { return payerPaidAmountMesssage; } -/** - * Get the report given a reportID - * - * @param {String} reportID - * @returns {Object} - */ -function getReport(reportID) { - // Deleted reports are set to null and lodashGet will still return null in that case, so we need to add an extra check - return lodashGet(allReports, `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {}) || {}; -} - /** * Gets transaction created, amount, currency and comment *