From fc71a297d877957a5b75fee15ddd1d0305809ea4 Mon Sep 17 00:00:00 2001 From: Shaurya Jain Date: Mon, 14 Jun 2021 09:38:28 +0530 Subject: [PATCH] actionsheet: Allow editing in all narrows Earlier, the messageActionSheet only allowed the 'Edit message' UI for stream, topic and PM (both 1:1 and group) narrows. This change now allows editing in all types of narrows. Fixes: #4671 --- src/message/messageActionSheet.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/message/messageActionSheet.js b/src/message/messageActionSheet.js index de60ba6d8d8..f358b42aa1e 100644 --- a/src/message/messageActionSheet.js +++ b/src/message/messageActionSheet.js @@ -17,7 +17,9 @@ import type { } from '../types'; import { getNarrowForReply, + isHomeNarrow, isPmNarrow, + isSpecialNarrow, isStreamOrTopicNarrow, isTopicNarrow, } from '../utils/narrow'; @@ -301,8 +303,10 @@ export const constructMessageActionButtons = ({ } if ( message.sender_id === ownUser.user_id - // Our "edit message" UI only works in certain kinds of narrows. - && (isStreamOrTopicNarrow(narrow) || isPmNarrow(narrow)) + && (isStreamOrTopicNarrow(narrow) + || isPmNarrow(narrow) + || isSpecialNarrow(narrow) + || isHomeNarrow(narrow)) ) { buttons.push(editMessage); }