subs: Call `filter.fix_stream_params` when updating stream privacy.

The navbar currently does not live update the stream icon correctly
for changes in stream privacy.

One place where the correct behaviour gets blocked is on the
`_is_stream_private` prop in the filter object. We keep props such as
this for convenience, to reduce calls to `subs`, however, this prop
becomes inconsistent with the value we get from `subs` when the stream
privacy is updated.

In this commit we add a call to `filter.fix_stream_params` in
`subs.update_stream_privacy`. This change does not fix the live
rerendering in the navbar because we don't call redraw yet, but
it's a prep commit to towards that goal
This commit is contained in:
YashRE42 2020-06-08 21:04:12 +00:00 committed by Tim Abbott
parent 35c8dcb599
commit d496304caa
1 changed files with 6 additions and 0 deletions

View File

@ -183,6 +183,12 @@ exports.update_stream_privacy = function (sub, values) {
stream_ui_updates.update_subscribers_count(sub);
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
const filter = narrow_state.filter();
if (filter && filter.operands("stream")[0] === sub.name) {
filter.fix_stream_params();
}
};
exports.update_stream_post_policy = function (sub, new_value) {