stream_color: Remove redundant update_historical option.

This option has no significance anymore. Both the callers to this
function pass it as `true`, so it is always true when it is being
run.
This commit is contained in:
Aman Agrawal
2023-04-07 20:37:32 +00:00
committed by Tim Abbott
parent e37f5082de
commit 397ca97060
2 changed files with 4 additions and 6 deletions

View File

@@ -68,7 +68,7 @@ export function set_colorpicker_color(colorpicker, color) {
});
}
export function update_stream_color(sub, color, {update_historical = false} = {}) {
export function update_stream_color(sub, color) {
sub.color = color;
const stream_id = sub.stream_id;
// The swatch in the subscription row header.
@@ -91,9 +91,7 @@ export function update_stream_color(sub, color, {update_historical = false} = {}
)}'] .large-icon`,
).css("color", color);
if (update_historical) {
update_historical_message_color(sub.name, color);
}
update_historical_message_color(sub.name, color);
update_stream_privacy_color(stream_id, color);
message_view_header.colorize_message_view_header();
}

View File

@@ -41,7 +41,7 @@ export function update_property(stream_id, property, value, other_values) {
switch (property) {
case "color":
stream_color.update_stream_color(sub, value, {update_historical: true});
stream_color.update_stream_color(sub, value);
break;
case "in_home_view":
// Legacy in_home_view events are only sent as duplicates of
@@ -117,7 +117,7 @@ export function mark_subscribed(sub, subscribers, color) {
// If the backend sent us a color, use that
if (color !== undefined && sub.color !== color) {
sub.color = color;
stream_color.update_stream_color(sub, color, {update_historical: true});
stream_color.update_stream_color(sub, color);
} else if (sub.color === undefined) {
// If the backend didn't, and we have a color already, send
// the backend that color. It's not clear this code path is