Skip to content

Commit

Permalink
Merge pull request #44252 from bernhardoj/fix/44237-hide-leave-button…
Browse files Browse the repository at this point in the history
…-for-own-policy-expense-chat

[CP Staging] Don't show leave button for own policy expense chat
  • Loading branch information
mountiny authored Jun 24, 2024
2 parents 24f3bdc + 17b10c4 commit 936b051
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
Report.leaveGroupChat(report.reportID);
}, [isChatRoom, isPolicyEmployee, isPolicyExpenseChat, report.reportID, report.visibility]);

const shouldShowLeaveButton = !isThread && (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy)) || (isPolicyExpenseChat && !isPolicyAdmin));
const shouldShowLeaveButton =
!isThread && (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy)) || (isPolicyExpenseChat && !report.isOwnPolicyExpenseChat && !isPolicyAdmin));

const reportName = ReportUtils.isDeprecatedGroupDM(report) || isGroupChat ? ReportUtils.getGroupChatName(undefined, false, report) : ReportUtils.getReportName(report);

Expand Down

0 comments on commit 936b051

Please sign in to comment.