diff --git a/static/js/subs.js b/static/js/subs.js index 9a51e6f436..6922ef3ebf 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -143,12 +143,17 @@ exports.update_stream_name = function (sub, new_name) { // Update navbar stream name if needed const filter = narrow_state.filter(); if (filter && filter.operands("stream")[0] === old_name) { - // TODO: This doesn't work, because the `filter` object - // represents the stream by name and hasn't been updated. + // This works, but it relies on `filter.fix_stream_params` masking + // some bad behaviour in the Filter object. In particular, the fact + // that the Filter object relies on the search box which doesn't + // rename the currently focused stream. // - // This will likely be fixed automatically as we migrate to - // using search pills and then a stream ID based - // representation of the stream in Filter objects. + // This will likely be improved as we migrate to using search pills + // and then a stream ID based representation of the stream in Filter. + + // update the stream_params stored in the filter object + filter.fix_stream_params(); + // use these to update the navbar tab_bar.render_title_area(); } };