mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +00:00
Revert "Fix that you have to save an edited message twice to complete the edit."
This reverts commit 87226d857845c6f16cb3bc0d6ab5bb748aca5987. This meant that if for some reason there's a server error or network failure trying to send in your edit, your changes are silently lost. (imported from commit 2b5d19716fef1565b061a2b6c7cecc54f183b6f3)
This commit is contained in:
@@ -14,21 +14,22 @@ exports.save = function (row) {
|
|||||||
if (new_content !== message.raw_content) {
|
if (new_content !== message.raw_content) {
|
||||||
request.content = new_content;
|
request.content = new_content;
|
||||||
}
|
}
|
||||||
if ((request.subject !== undefined) ||
|
if (request.subject === undefined &&
|
||||||
(request.content !== undefined)) {
|
request.content === undefined) {
|
||||||
$.ajax({
|
// If they didn't change anything, just cancel it.
|
||||||
type: 'POST',
|
return message_edit.cancel(row);
|
||||||
url: '/json/update_message',
|
|
||||||
data: request,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function (data) {
|
|
||||||
if (msg_list === current_msg_list) {
|
|
||||||
message_edit.cancel(row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
message_edit.cancel(row);
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: '/json/update_message',
|
||||||
|
data: request,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
if (msg_list === current_msg_list) {
|
||||||
|
message_edit.cancel(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
// The message will automatically get replaced when it arrives.
|
// The message will automatically get replaced when it arrives.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user