Refactor setDefaultLabels for clarity

pull/1858/head
Jared Scheib 2017-08-09 16:03:31 -07:00
parent 38425b4306
commit 62e1e52ab8
1 changed files with 6 additions and 7 deletions

View File

@ -23,13 +23,12 @@ class DisplayOptions extends Component {
}
setDefaultLabels(axes, queryConfigs) {
if (!queryConfigs.length) {
return axes
}
const defaultYLabel = buildDefaultYLabel(queryConfigs[0])
return {...axes, y: {...axes.y, defaultYLabel}}
return queryConfigs.length
? {
...axes,
y: {...axes.y, defaultYLabel: buildDefaultYLabel(queryConfigs[0])},
}
: axes
}
render() {