From 9a30b51e6e0143897b1192ae8dd027b4a927ff2c Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 8 Jan 2019 00:28:01 +0000 Subject: [PATCH] minor: Simplify maybe_add_narrowed_messages. We eliminate the messages_are_new parameter, which was always set to `true`. --- static/js/message_events.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/message_events.js b/static/js/message_events.js index 0d3e0c1de2..b9c8feb741 100644 --- a/static/js/message_events.js +++ b/static/js/message_events.js @@ -2,7 +2,7 @@ var message_events = (function () { var exports = {}; -function maybe_add_narrowed_messages(messages, msg_list, messages_are_new) { +function maybe_add_narrowed_messages(messages, msg_list) { var ids = []; _.each(messages, function (elem) { ids.push(elem.id); @@ -41,7 +41,7 @@ function maybe_add_narrowed_messages(messages, msg_list, messages_are_new) { message_util.add_messages( new_messages, msg_list, - {messages_are_new: messages_are_new} + {messages_are_new: true} ); unread_ops.process_visible(); notifications.notify_messages_outside_current_search(elsewhere_messages); @@ -52,7 +52,7 @@ function maybe_add_narrowed_messages(messages, msg_list, messages_are_new) { if (msg_list === current_msg_list) { // Don't actually try again if we unnarrowed // while waiting - maybe_add_narrowed_messages(messages, msg_list, messages_are_new); + maybe_add_narrowed_messages(messages, msg_list); } }, 5000); }}); @@ -77,7 +77,7 @@ exports.insert_new_messages = function insert_new_messages(messages, locally_ech message_util.add_messages(messages, message_list.narrowed, {messages_are_new: true}); } else { // if we cannot apply locally, we have to wait for this callback to happen to notify - maybe_add_narrowed_messages(messages, message_list.narrowed, true); + maybe_add_narrowed_messages(messages, message_list.narrowed); } } else { // we're in the home view, so update its list