mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
Only clear the compose box if a message was locally echoed
(imported from commit a90a566f61e939e34eab9666743848e47c122400)
This commit is contained in:
@@ -478,7 +478,7 @@ function clear_compose_box() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.send_message_success = function (local_id, message_id, start_time, locally_echoed) {
|
exports.send_message_success = function (local_id, message_id, start_time, locally_echoed) {
|
||||||
if (! feature_flags.local_echo) {
|
if (! feature_flags.local_echo || !locally_echoed) {
|
||||||
clear_compose_box();
|
clear_compose_box();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,9 +526,10 @@ function send_message(request) {
|
|||||||
request.local_id = local_id;
|
request.local_id = local_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var locally_echoed = local_id !== undefined;
|
||||||
|
|
||||||
function success(data) {
|
function success(data) {
|
||||||
exports.send_message_success(local_id, data.id, start_time, local_id !== undefined);
|
exports.send_message_success(local_id, data.id, start_time, locally_echoed);
|
||||||
}
|
}
|
||||||
|
|
||||||
function error(response) {
|
function error(response) {
|
||||||
@@ -549,7 +550,7 @@ function send_message(request) {
|
|||||||
blueslip.error("Restarting get_updates because it was not running during send");
|
blueslip.error("Restarting get_updates because it was not running during send");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feature_flags.local_echo) {
|
if (feature_flags.local_echo && locally_echoed) {
|
||||||
clear_compose_box();
|
clear_compose_box();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user