Fix logic in single stat coloration getter

Sometimes results in a situation where coloration state gets set to a
weird value, which seems to be a factor in the auto refresh bug
pull/10616/head
Alex P 2018-02-08 11:02:34 -08:00
parent 90b36ebc76
commit 1de16619be
1 changed files with 3 additions and 1 deletions

View File

@ -143,9 +143,11 @@ export const validateSingleStatColors = (colors, coloration) => {
export const getSingleStatColoration = colors => { export const getSingleStatColoration = colors => {
if (!colors || colors.length === 0) { if (!colors || colors.length === 0) {
return SINGLE_STAT_TEXT return SINGLE_STAT_TEXT
} else if (colors[0].type === (SINGLE_STAT_TEXT || SINGLE_STAT_BG)) {
return colors[0].type
} }
return colors[0].type return SINGLE_STAT_TEXT
} }
export const validateGaugeColors = colors => { export const validateGaugeColors = colors => {