mirror of https://github.com/apache/superset.git
[fix] JS error out when rename a new chart (#6752)
This commit is contained in:
parent
97cb10dbc8
commit
879c553b0a
|
@ -176,10 +176,12 @@ AnnotationLayerControl.defaultProps = defaultProps;
|
||||||
// directly, could not figure out how to get access to the color_scheme
|
// directly, could not figure out how to get access to the color_scheme
|
||||||
function mapStateToProps({ charts, explore }) {
|
function mapStateToProps({ charts, explore }) {
|
||||||
const chartKey = getChartKey(explore);
|
const chartKey = getChartKey(explore);
|
||||||
|
const chart = charts[chartKey] || charts[0] || {};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
colorScheme: (explore.controls || {}).color_scheme.value,
|
colorScheme: (explore.controls || {}).color_scheme.value,
|
||||||
annotationError: charts[chartKey].annotationError,
|
annotationError: chart.annotationError,
|
||||||
annotationQuery: charts[chartKey].annotationQuery,
|
annotationQuery: chart.annotationQuery,
|
||||||
vizType: explore.controls.viz_type.value,
|
vizType: explore.controls.viz_type.value,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue