From 1ce4e9fd56a0ad791b8f230e2720a24bd7838c89 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 22 Apr 2024 17:46:39 +0700 Subject: [PATCH] renam function --- src/libs/ReportUtils.ts | 8 ++++---- src/pages/home/HeaderView.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 15297be880bc..db958c82936f 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5974,7 +5974,7 @@ function canLeavePolicyExpenseChat(report: OnyxEntry, policy: OnyxEntry< /** * Whether the user can join a report */ -function canJoinReport(report: OnyxEntry, parentReportAction: OnyxEntry, policy: OnyxEntry): boolean { +function canJoinChat(report: OnyxEntry, parentReportAction: OnyxEntry, policy: OnyxEntry): boolean { if (ReportActionsUtils.isWhisperAction(parentReportAction)) { return false; } @@ -5993,7 +5993,7 @@ function canJoinReport(report: OnyxEntry, parentReportAction: OnyxEntry< /** * Whether the user can leave a report */ -function canLeaveReport(report: OnyxEntry, policy: OnyxEntry): boolean { +function canLeaveChat(report: OnyxEntry, policy: OnyxEntry): boolean { if (isSelfDM(report) || isParentGroupChat(report)) { return false; } @@ -6126,8 +6126,8 @@ export { canFlagReportAction, canLeavePolicyExpenseChat, canLeaveRoom, - canJoinReport, - canLeaveReport, + canJoinChat, + canLeaveChat, canReportBeMentionedWithinPolicy, canRequestMoney, canSeeDefaultRoom, diff --git a/src/pages/home/HeaderView.tsx b/src/pages/home/HeaderView.tsx index 1d11d324a983..9c35b741d8eb 100644 --- a/src/pages/home/HeaderView.tsx +++ b/src/pages/home/HeaderView.tsx @@ -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,