Skip to content

Commit

Permalink
Merge pull request #27833 from hungvu193/fix-27348
Browse files Browse the repository at this point in the history
prevent showing green dot with archived parent report
  • Loading branch information
aldo-expensify authored Sep 25, 2023
2 parents 84247de + f593278 commit 767bdae
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*
Expand All @@ -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.
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit 767bdae

Please sign in to comment.