Skip to content

Commit

Permalink
Fix displaying Concierge chat report
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed Jan 17, 2024
1 parent ac788bb commit 1d67d2d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,21 @@ function hasReportCommonPolicyMemberWithArray(report: Report, policyMembersAccou
return false;
}

/**
* Only returns true if this is our main 1:1 DM report with Concierge
*/
function isConciergeChatReport(report: OnyxEntry<Report>): boolean {
return report?.participantAccountIDs?.length === 1 && Number(report.participantAccountIDs?.[0]) === CONST.ACCOUNT_ID.CONCIERGE && !isChatThread(report);

Check failure on line 646 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / lint

'isChatThread' was used before it was defined
}

/**
* Checks if the supplied report belongs to workspace based on the provided params.
*/
function doesReportBelongToWorkspace(report: Report, policyID: string, policyMembersAccountIDs: string[]) {
return report.policyID === CONST.POLICY.ID_FAKE || !report.policyID ? hasReportCommonPolicyMemberWithArray(report, policyMembersAccountIDs) : report.policyID === policyID;
return (
isConciergeChatReport(report) ||
(report.policyID === CONST.POLICY.ID_FAKE || !report.policyID ? hasReportCommonPolicyMemberWithArray(report, policyMembersAccountIDs) : report.policyID === policyID)
);
}

/**
Expand Down Expand Up @@ -860,13 +870,6 @@ function isDM(report: OnyxEntry<Report>): boolean {
return isChatReport(report) && !getChatType(report);
}

/**
* Only returns true if this is our main 1:1 DM report with Concierge
*/
function isConciergeChatReport(report: OnyxEntry<Report>): boolean {
return report?.participantAccountIDs?.length === 1 && Number(report.participantAccountIDs?.[0]) === CONST.ACCOUNT_ID.CONCIERGE && !isChatThread(report);
}

/**
* Returns true if report is still being processed
*/
Expand Down

0 comments on commit 1d67d2d

Please sign in to comment.