Only pick a new color if the new subscription doesn't already have one

(imported from commit 7ccba8ab3ee52e81a8e553a43dce4c8bfc17f1fc)
This commit is contained in:
Zev Benjamin 2013-05-01 21:22:44 -04:00
parent 419f49c8be
commit 16cd33f756
1 changed files with 4 additions and 1 deletions

View File

@ -226,10 +226,13 @@ function create_sub(stream_name, attrs) {
return sub;
}
sub = $.extend({}, {name: stream_name, color: pick_color(), id: next_sub_id++,
sub = $.extend({}, {name: stream_name, id: next_sub_id++,
render_subscribers: should_render_subscribers(),
subscribed: true, in_home_view: true, invite_only: false,
notifications: false}, attrs);
if (sub.color === undefined) {
sub.color = pick_color();
}
mark_color_used(sub.color);
add_sub(stream_name, sub);