Skip to content

Commit

Permalink
Merge pull request #44249 from bernhardoj/fix/44202-hide-join-button-…
Browse files Browse the repository at this point in the history
…in-track-expense

Hide join button in track expense report

(cherry picked from commit 1ab01f6)
  • Loading branch information
arosiclair authored and OSBotify committed Jun 24, 2024
1 parent 7e92577 commit 656397f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6843,8 +6843,9 @@ function canJoinChat(report: OnyxInputOrEntry<Report>, parentReportAction: OnyxI
return false;
}

const isExpenseChat = isMoneyRequestReport(report) || isMoneyRequest(report) || isInvoiceReport(report) || isTrackExpenseReport(report);
// Anyone viewing these chat types is already a participant and therefore cannot join
if (isRootGroupChat(report) || isSelfDM(report) || isInvoiceRoom(report) || isSystemChat(report)) {
if (isRootGroupChat(report) || isSelfDM(report) || isInvoiceRoom(report) || isSystemChat(report) || isExpenseChat) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
const shouldShowHoldAction =
caseID !== CASES.MONEY_REPORT && (canHoldUnholdReportAction.canHoldRequest || canHoldUnholdReportAction.canUnholdRequest) && !ReportUtils.isArchivedRoom(parentReport);

const canJoin = !isExpenseReport && ReportUtils.canJoinChat(report, parentReportAction, policy);
const canJoin = ReportUtils.canJoinChat(report, parentReportAction, policy);

const promotedActions = useMemo(() => {
const result: PromotedAction[] = [];
Expand Down

0 comments on commit 656397f

Please sign in to comment.