Skip to content

Commit

Permalink
Add isExpensifyOnlyParticipantInReport function back since its used b…
Browse files Browse the repository at this point in the history
…y tests
  • Loading branch information
puneetlath committed Oct 31, 2023
1 parent 8bc920f commit f35acb9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,16 @@ function shouldDisableDetailPage(report) {
return false;
}

/**
* Returns true if this report has only one participant and it's an Expensify account.
* @param {Object} report
* @returns {Boolean}
*/
function isExpensifyOnlyParticipantInReport(report) {
const reportParticipants = _.without(lodashGet(report, 'participantAccountIDs', []), currentUserAccountID);
return reportParticipants.length === 1 && _.some(reportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID));
}

/**
* Returns whether a given report can have tasks created in it.
* We only prevent the task option if it's a DM/group-DM and the other users are all special Expensify accounts
Expand Down Expand Up @@ -4156,6 +4166,7 @@ export {
getPolicyName,
getPolicyType,
isArchivedRoom,
isExpensifyOnlyParticipantInReport,
canCreateTaskInReport,
isPolicyExpenseChatAdmin,
isPolicyAdmin,
Expand Down

0 comments on commit f35acb9

Please sign in to comment.