Don't color the hero if the tag doesn't have a color

This commit is contained in:
Toby Zerner 2015-06-19 17:26:01 +09:30
parent 82f487c4bb
commit 6aff8ebca5

View File

@ -27,8 +27,11 @@ export default function() {
extend(DiscussionHero.prototype, 'view', function(view) {
var tags = sortTags(this.props.discussion.tags());
if (tags && tags.length) {
view.attrs.style = 'background-color: '+tags[0].color();
view.attrs.className += ' discussion-hero-colored';
var color = tags[0].color();
if (color) {
view.attrs.style = 'background-color: '+color;
view.attrs.className += ' discussion-hero-colored';
}
}
});