From bb6ce47c33e8122d0078469915324f869ee9beeb Mon Sep 17 00:00:00 2001 From: YashRE42 <33805964+YashRE42@users.noreply.github.com> Date: Mon, 8 Jun 2020 21:41:08 +0000 Subject: [PATCH] navbar: Live update icon for stream privacy changes. Prior to this commit the icon in the navbar didn't live update to reflect changes in stream privacy. Here, we add a call to `tab_bar.render_title_area` in `subs.update_stream_privacy()`, to enable live updates on the icon. Fixes #14728. --- static/js/subs.js | 5 ++++- static/js/tab_bar.js | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/static/js/subs.js b/static/js/subs.js index 6118029150..9a51e6f436 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -184,10 +184,13 @@ exports.update_stream_privacy = function (sub, values) { stream_ui_updates.update_add_subscriptions_elements(sub); stream_list.redraw_stream_privacy(sub); - // update the stream_params stored in the filter object if needed + // Update navbar stream name if needed const filter = narrow_state.filter(); if (filter && filter.operands("stream")[0] === sub.name) { + // update the stream_params stored in the filter object filter.fix_stream_params(); + // use these to update the navbar + tab_bar.render_title_area(); } }; diff --git a/static/js/tab_bar.js b/static/js/tab_bar.js index 581b4a896f..9d21d0e76c 100644 --- a/static/js/tab_bar.js +++ b/static/js/tab_bar.js @@ -151,9 +151,8 @@ exports.initialize = function () { }; exports.render_title_area = function () { - // TODO: Implement rerendering for stream privacy or subscriber - // count changes. We simply need to call this function in the - // appropriate places. + // TODO: Implement rerendering for subscriber count changes. + // We simply need to call this function in the appropriate places. const filter = narrow_state.filter(); build_tab_bar(filter); };