|
|
@@ -16,15 +16,14 @@ class Toolbar extends React.Component {
|
|
|
|
|
|
filterUsingChange = (e) => {
|
|
|
const key = e.target.dataset.key;
|
|
|
- const props = this.props;
|
|
|
- const chartDesigner = props.chartDesigner;
|
|
|
+ const { chartDesigner, dispatch, autoRefresh } = this.props;
|
|
|
const filters = chartDesigner.filters;
|
|
|
- props.dispatch({ type: 'chartDesigner/changeField', name: 'filters', value: filters.map( f => {
|
|
|
+ dispatch({ type: 'chartDesigner/changeField', name: 'filters', value: filters.map( f => {
|
|
|
if(+f.key === +key) {
|
|
|
f = { ...f, using: !f.using }
|
|
|
}
|
|
|
return f;
|
|
|
- }) });
|
|
|
+ }), autoRefresh });
|
|
|
}
|
|
|
|
|
|
showFilterBox = (e) => {
|
|
|
@@ -40,7 +39,8 @@ class Toolbar extends React.Component {
|
|
|
}
|
|
|
|
|
|
createFilters = (filters) => {
|
|
|
- this.props.dispatch({ type: 'chartDesigner/changeField', name: 'filters', value: filters });
|
|
|
+ const { autoRefresh, dispatch } = this.props;
|
|
|
+ dispatch({ type: 'chartDesigner/changeField', name: 'filters', value: filters, autoRefresh });
|
|
|
this.hideFilterBox()
|
|
|
}
|
|
|
|