message view: Show message source button until message successfully sent.

This commit removes the unless msg/locally_echoed condition for the
edit content div, which has the consequence of making the "view
message source" widget always available for locally echoed
messages. This ensures that the message source can be seen if a very
long message has been drafted and it fails due to a server-side error
(See #17425 for the original report).

Fixes #17650.
This commit is contained in:
Signior-X
2021-03-17 07:20:55 +05:30
committed by Tim Abbott
parent 88f351cdee
commit e1c4c7b802
2 changed files with 4 additions and 7 deletions

View File

@@ -95,14 +95,13 @@ function message_hover(message_row) {
if (current_message_hover && rows.id(current_message_hover) === id) {
return;
}
// Don't allow on-hover editing for local-only messages
if (message_row.hasClass("local")) {
return;
}
const message = current_msg_list.get(rows.id(message_row));
message_unhover();
current_message_hover = message_row;
// Locally echoed messages have !is_topic_editable and thus go
// through this code path.
if (!message_edit.is_topic_editable(message)) {
// The actions and reactions icon hover logic is handled entirely by CSS
return;

View File

@@ -1,8 +1,6 @@
<div class="message_controls{{#status_message}} sender-status-controls{{/status_message}} no-select">
{{#if msg/sent_by_me}}
{{#unless msg/locally_echoed}}
<div class="edit_content"></div>
{{/unless}}
<div class="edit_content"></div>
{{/if}}
{{#unless msg/sent_by_me}}