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.
This commit is contained in:
YashRE42
2020-06-08 21:41:08 +00:00
committed by Tim Abbott
parent d496304caa
commit bb6ce47c33
2 changed files with 6 additions and 4 deletions

View File

@@ -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();
}
};

View File

@@ -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);
};