mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
refactor: Remove stream_name param in update_stream_color().
This commit is contained in:
@@ -88,7 +88,7 @@ exports.set_colorpicker_color = function (colorpicker, color) {
|
|||||||
{color: color, container: "#subscription_overlay .subscription_settings.show"}));
|
{color: color, container: "#subscription_overlay .subscription_settings.show"}));
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.update_stream_color = function (sub, stream_name, color, opts) {
|
exports.update_stream_color = function (sub, color, opts) {
|
||||||
opts = _.defaults({}, opts, {update_historical: false});
|
opts = _.defaults({}, opts, {update_historical: false});
|
||||||
sub.color = color;
|
sub.color = color;
|
||||||
var id = parseInt(sub.stream_id, 10);
|
var id = parseInt(sub.stream_id, 10);
|
||||||
@@ -99,7 +99,7 @@ exports.update_stream_color = function (sub, stream_name, color, opts) {
|
|||||||
$("#subscription_overlay .subscription_settings[data-stream-id='" + id + "'] .large-icon").css("color", color);
|
$("#subscription_overlay .subscription_settings[data-stream-id='" + id + "'] .large-icon").css("color", color);
|
||||||
|
|
||||||
if (opts.update_historical) {
|
if (opts.update_historical) {
|
||||||
update_historical_message_color(stream_name, color);
|
update_historical_message_color(sub.name, color);
|
||||||
}
|
}
|
||||||
update_stream_sidebar_swatch_color(id, color);
|
update_stream_sidebar_swatch_color(id, color);
|
||||||
tab_bar.colorize_tab_bar();
|
tab_bar.colorize_tab_bar();
|
||||||
|
|||||||
@@ -827,11 +827,10 @@ exports.update_subscription_properties = function (stream_id, property, value) {
|
|||||||
value: value});
|
value: value});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var stream_name = sub.name;
|
|
||||||
|
|
||||||
switch (property) {
|
switch (property) {
|
||||||
case 'color':
|
case 'color':
|
||||||
stream_color.update_stream_color(sub, stream_name, value, {update_historical: true});
|
stream_color.update_stream_color(sub, value, {update_historical: true});
|
||||||
break;
|
break;
|
||||||
case 'in_home_view':
|
case 'in_home_view':
|
||||||
update_in_home_view(sub, value);
|
update_in_home_view(sub, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user