Skip to content

Commit

Permalink
Merge pull request #21481 from esh-g/isThread-concierge-report
Browse files Browse the repository at this point in the history
Is thread concierge report
  • Loading branch information
tylerkaraszewski authored Jun 28, 2023
2 parents 98f7abc + 72f8a08 commit 054b71b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,24 @@ function getBankAccountRoute(report) {
return isPolicyExpenseChat(report) ? ROUTES.getBankAccountRoute('', report.policyID) : ROUTES.SETTINGS_ADD_BANK_ACCOUNT;
}

/**
* Returns true if report has a parent and is therefore a Thread.
*
* @param {Object} report
* @returns {Boolean}
*/
function isThread(report) {
return Boolean(report && report.parentReportID && report.parentReportActionID && report.type === CONST.REPORT.TYPE.CHAT);
}

/**
* Only returns true if this is our main 1:1 DM report with Concierge
*
* @param {Object} report
* @returns {Boolean}
*/
function isConciergeChatReport(report) {
return lodashGet(report, 'participantAccountIDs', []).length === 1 && Number(report.participantAccountIDs[0]) === CONST.ACCOUNT_ID.CONCIERGE;
return lodashGet(report, 'participantAccountIDs', []).length === 1 && Number(report.participantAccountIDs[0]) === CONST.ACCOUNT_ID.CONCIERGE && !isThread(report);
}

/**
Expand Down Expand Up @@ -530,16 +540,6 @@ function isPolicyExpenseChatAdmin(report, policies) {
return policyRole === CONST.POLICY.ROLE.ADMIN;
}

/**
* Returns true if report has a parent and is therefore a Thread.
*
* @param {Object} report
* @returns {Boolean}
*/
function isThread(report) {
return Boolean(report && report.parentReportID && report.parentReportActionID && report.type === CONST.REPORT.TYPE.CHAT);
}

/**
* Returns true if reportAction has a child.
*
Expand Down

0 comments on commit 054b71b

Please sign in to comment.