mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
filter: Store reference to _sub instead of _stream_params.
In commit 4f6377d493 we added
`_stream_params` as a way of storing attributes such as stream name
and stream privacy, this involved adding a few calls within functions
that updated these values (in order to maintain consistency).
This commit replaces `_stream_params` with an always consistent `_sub`
object and removes unnecessary `_stream_params` related code. Once the
`_sub` object is available, calls to `stream_data` may be considered
suspicious as they can often be avoided by just picking the desired
attribute off of the `_sub` object.
This commit is contained in:
@@ -49,9 +49,8 @@ function make_tab_data(filter) {
|
||||
|
||||
exports.colorize_tab_bar = function () {
|
||||
const filter = narrow_state.filter();
|
||||
if (filter === undefined || !filter.has_operator('stream') || !filter._stream_params) {return;}
|
||||
const color_for_stream = stream_data.get_color(filter._stream_params._stream_name);
|
||||
$("#tab_list .stream > .fa").css('color', color_for_stream);
|
||||
if (filter === undefined || !filter._sub) {return;}
|
||||
$("#tab_list .stream > .fa").css('color', filter._sub.color);
|
||||
};
|
||||
|
||||
function append_and_display_title_area(tab_bar_data) {
|
||||
|
||||
Reference in New Issue
Block a user