[dashboard fix] force refresh charts under tabs (#5291)

This commit is contained in:
Grace Guo
2018-06-26 17:46:28 -07:00
committed by GitHub
parent 05a39b395a
commit 4ee984c6de

View File

@@ -202,5 +202,10 @@ export function runQuery(formData, force = false, timeout = 60, key) {
}
export function refreshChart(chart, force, timeout) {
return dispatch => dispatch(runQuery(chart.latestQueryFormData, force, timeout, chart.id));
return (dispatch) => {
if (!chart.latestQueryFormData || Object.keys(chart.latestQueryFormData).length === 0) {
return;
}
dispatch(runQuery(chart.latestQueryFormData, force, timeout, chart.id));
};
}