Skip to content

Commit

Permalink
actionsheet: Allow editing in all narrows
Browse files Browse the repository at this point in the history
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: zulip#4671
  • Loading branch information
shaurya2612 committed Jun 14, 2021
1 parent 807f6c1 commit fc71a29
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/message/messageActionSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import type {
} from '../types';
import {
getNarrowForReply,
isHomeNarrow,
isPmNarrow,
isSpecialNarrow,
isStreamOrTopicNarrow,
isTopicNarrow,
} from '../utils/narrow';
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit fc71a29

Please sign in to comment.