Skip to content

Commit

Permalink
check if participant is empty or not
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Nov 3, 2023
1 parent d53a03e commit 3e9b11c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ function isExpensifyOnlyParticipantInReport(report) {
*/
function canCreateTaskInReport(report) {
const otherReportParticipants = _.without(lodashGet(report, 'participantAccountIDs', []), currentUserAccountID);
const areExpensifyAccountsOnlyOtherParticipants = _.every(otherReportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID));
const areExpensifyAccountsOnlyOtherParticipants =
otherReportParticipants.length >= 1 && _.every(otherReportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID));
if (areExpensifyAccountsOnlyOtherParticipants && isDM(report)) {
return false;
}
Expand Down

0 comments on commit 3e9b11c

Please sign in to comment.