diff --git a/static/js/stream_color.js b/static/js/stream_color.js index 95ad5dd5cf..6c6a6bae3b 100644 --- a/static/js/stream_color.js +++ b/static/js/stream_color.js @@ -88,7 +88,7 @@ exports.set_colorpicker_color = function (colorpicker, color) { {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}); sub.color = color; 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); 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); tab_bar.colorize_tab_bar(); diff --git a/static/js/subs.js b/static/js/subs.js index 6b32c7ccea..d7a08b53a9 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -827,11 +827,10 @@ exports.update_subscription_properties = function (stream_id, property, value) { value: value}); return; } - var stream_name = sub.name; switch (property) { 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; case 'in_home_view': update_in_home_view(sub, value);