diff --git a/static/js/stream_list.js b/static/js/stream_list.js index 896dfb8a0e..0ebe37279d 100644 --- a/static/js/stream_list.js +++ b/static/js/stream_list.js @@ -64,7 +64,7 @@ function get_filter_li(type, name) { if (type === 'stream') { return $("#stream_sidebar_" + subs.stream_id(name)); } else if (type === "private") { - return $(".user_sidebar_entry > a[data-email='" + name + "']"); + return $("li.user_sidebar_entry[data-email='" + name + "']"); } return iterate_to_find("#" + type + "_filters > li", name); } diff --git a/static/js/ui.js b/static/js/ui.js index 3302717427..7506687db6 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -1483,6 +1483,10 @@ exports.set_presence_list = function (users, presence_info) { var user_info = [my_info].concat(_.map(user_emails, info_for)); $('#user_presences').html(templates.render('user_presence_rows', {users: user_info})); + // FIXME: This should probably be rendered in the template directly, but + // currently we have to update unread counts after rendering the template + // or they get blown away. + update_unread_counts(); }; // Save the compose content cursor position and restore when we diff --git a/tools/jslint/check-all.js b/tools/jslint/check-all.js index 7fae99ab8d..722090f55a 100644 --- a/tools/jslint/check-all.js +++ b/tools/jslint/check-all.js @@ -56,6 +56,7 @@ var globals = + ' mark_message_as_read' + ' send_summarize_in_home' + ' send_summarize_in_stream' + + ' update_unread_counts' ;