Fix buggy update_streams_sidebar().

If you were narrowed to an unpinned stream, and then pinned it,
we were mostly redrawing the sidebar correctly, but we weren't
setting the active-filter class.  Now we accomplish this by
calling maybe_activate_stream_item(), which also reduces some
code duplication.  (The new code introduces a bit of extra logic
to do `stream_li.addClass('active-filter')`.
This commit is contained in:
Steve Howell
2017-05-14 11:58:11 -07:00
committed by Tim Abbott
parent 5b6bd6767b
commit 76f68e9836

View File

@@ -294,14 +294,9 @@ exports.update_streams_sidebar = function () {
return;
}
var op_stream = narrow_state.filter().operands('stream');
if (op_stream.length !== 0) {
var stream_name = op_stream[0];
var stream_id = stream_data.get_stream_id(stream_name);
if (stream_id && stream_data.id_is_subscribed(stream_id)) {
rebuild_recent_topics(stream_name);
}
}
var filter = narrow_state.filter();
exports.maybe_activate_stream_item(filter);
};
exports.update_dom_with_unread_counts = function (counts) {