Skip to content

Commit

Permalink
Merge pull request #31676 from tienifr/fix/30644
Browse files Browse the repository at this point in the history
Disable thread functions for whisper message
  • Loading branch information
srikarparsi authored Dec 14, 2023
2 parents 06662fa + 4512edc commit d9f8772
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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'),
Expand Down
10 changes: 8 additions & 2 deletions src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,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) {
Expand Down Expand Up @@ -162,7 +167,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', '');
Expand Down

0 comments on commit d9f8772

Please sign in to comment.