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:
Steve Howell
2017-09-26 12:04:23 -07:00
committed by Tim Abbott
parent fa6a118d51
commit b32c3273dc
2 changed files with 2 additions and 24 deletions

View File

@@ -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) {