Skip to content

Commit

Permalink
renam function
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Apr 22, 2024
1 parent 10f3079 commit 1ce4e9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5974,7 +5974,7 @@ function canLeavePolicyExpenseChat(report: OnyxEntry<Report>, policy: OnyxEntry<
/**
* Whether the user can join a report
*/
function canJoinReport(report: OnyxEntry<Report>, parentReportAction: OnyxEntry<ReportAction>, policy: OnyxEntry<Policy>): boolean {
function canJoinChat(report: OnyxEntry<Report>, parentReportAction: OnyxEntry<ReportAction>, policy: OnyxEntry<Policy>): boolean {
if (ReportActionsUtils.isWhisperAction(parentReportAction)) {
return false;
}
Expand All @@ -5993,7 +5993,7 @@ function canJoinReport(report: OnyxEntry<Report>, parentReportAction: OnyxEntry<
/**
* Whether the user can leave a report
*/
function canLeaveReport(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
function canLeaveChat(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
if (isSelfDM(report) || isParentGroupChat(report)) {
return false;
}
Expand Down Expand Up @@ -6126,8 +6126,8 @@ export {
canFlagReportAction,
canLeavePolicyExpenseChat,
canLeaveRoom,
canJoinReport,
canLeaveReport,
canJoinChat,
canLeaveChat,
canReportBeMentionedWithinPolicy,
canRequestMoney,
canSeeDefaultRoom,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ function HeaderView({report, personalDetails, parentReport, parentReportAction,
Report.updateNotificationPreference(reportID, report.notificationPreference, CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS, false, report.parentReportID, report.parentReportActionID),
);

const canJoin = ReportUtils.canJoinReport(report, parentReportAction, policy);
const canJoin = ReportUtils.canJoinChat(report, parentReportAction, policy);
if (canJoin) {
threeDotMenuItems.push({
icon: Expensicons.ChatBubbles,
text: translate('common.join'),
onSelected: join,
});
} else if (ReportUtils.canLeaveReport(report, policy)) {
} else if (ReportUtils.canLeaveChat(report, policy)) {
const isWorkspaceMemberLeavingWorkspaceRoom = !isChatThread && (report.visibility === CONST.REPORT.VISIBILITY.RESTRICTED || isPolicyExpenseChat) && isPolicyEmployee;
threeDotMenuItems.push({
icon: Expensicons.ChatBubbles,
Expand Down

0 comments on commit 1ce4e9f

Please sign in to comment.