mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Always re-render locally echoed messages.
Our old optimizations to prevent re-rendering of locally echoed messages created a lot of code complexity. This commit is an experiment to simplify the code, which it clearly does. The danger of re-rendering messages is flicker, but our message view has changed since the original local echo code was written.
This commit is contained in:
@@ -102,21 +102,6 @@ exports.update_starred = function (message_id, starred) {
|
||||
});
|
||||
};
|
||||
|
||||
var local_messages_to_show = [];
|
||||
var show_message_timestamps = _.throttle(function () {
|
||||
_.each(local_messages_to_show, function (message_id) {
|
||||
update_message_in_all_views(message_id, function update_row(row) {
|
||||
row.find('.message_time').toggleClass('notvisible', false);
|
||||
});
|
||||
});
|
||||
local_messages_to_show = [];
|
||||
}, 100);
|
||||
|
||||
exports.show_local_message_arrived = function (message_id) {
|
||||
local_messages_to_show.push(message_id);
|
||||
show_message_timestamps();
|
||||
};
|
||||
|
||||
exports.show_message_failed = function (message_id, failed_msg) {
|
||||
// Failed to send message, so display inline retry/cancel
|
||||
update_message_in_all_views(message_id, function update_row(row) {
|
||||
|
||||
Reference in New Issue
Block a user