From 7b71b8ee817493496a02007cd9d3e6e894a21059 Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 22 Nov 2023 14:44:16 +0700 Subject: [PATCH 1/2] disable thread functions for whisper message --- .../home/report/ContextMenu/ContextMenuActions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index 4f35926c5957..649475021ef8 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -130,7 +130,12 @@ export default [ const isIOUAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && !ReportActionsUtils.isSplitBillAction(reportAction); const isModifiedExpenseAction = ReportActionsUtils.isModifiedExpenseAction(reportAction); const isTaskAction = ReportActionsUtils.isTaskAction(reportAction); - return (isCommentAction || isReportPreviewAction || isIOUAction || isModifiedExpenseAction || isTaskAction) && !ReportUtils.isThreadFirstChat(reportAction, reportID); + const isWhisperAction = ReportActionsUtils.isWhisperAction(reportAction); + return ( + !isWhisperAction && + (isCommentAction || isReportPreviewAction || isIOUAction || isModifiedExpenseAction || isTaskAction) && + !ReportUtils.isThreadFirstChat(reportAction, reportID) + ); }, onPress: (closePopover, {reportAction, reportID}) => { if (closePopover) { @@ -161,7 +166,8 @@ export default [ const isCommentAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID); const isReportPreviewAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW; const isIOUAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && !ReportActionsUtils.isSplitBillAction(reportAction); - return !subscribed && (isCommentAction || isReportPreviewAction || isIOUAction); + const isWhisperAction = ReportActionsUtils.isWhisperAction(reportAction); + return !subscribed && !isWhisperAction && (isCommentAction || isReportPreviewAction || isIOUAction); }, onPress: (closePopover, {reportAction, reportID}) => { let childReportNotificationPreference = lodashGet(reportAction, 'childReportNotificationPreference', ''); From 4512edcaca776299f7c90c6a55aaa373243fea14 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 8 Dec 2023 03:41:38 +0700 Subject: [PATCH 2/2] hide Join menu with whisper thread --- src/pages/home/HeaderView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 5b57419c8530..51593bd49b50 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -102,6 +102,7 @@ function HeaderView(props) { const parentReportAction = ReportActionsUtils.getParentReportAction(props.report); const isCanceledTaskReport = ReportUtils.isCanceledTaskReport(props.report, parentReportAction); const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(props.report.reportID); + const isWhisperAction = ReportActionsUtils.isWhisperAction(parentReportAction); const isEmptyChat = !props.report.lastMessageText && !props.report.lastMessageTranslationKey && !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey; const isUserCreatedPolicyRoom = ReportUtils.isUserCreatedPolicyRoom(props.report); const isPolicyMember = useMemo(() => !_.isEmpty(props.policy), [props.policy]); @@ -134,7 +135,7 @@ function HeaderView(props) { } if ((isChatThread && !isEmptyChat) || isUserCreatedPolicyRoom || canLeaveRoom) { - if (props.report.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) { + if (!isWhisperAction && props.report.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) { threeDotMenuItems.push({ icon: Expensicons.ChatBubbles, text: translate('common.join'),