From 48145bea3aff600f78a00517486e2e1bf2c81b8a Mon Sep 17 00:00:00 2001 From: Kamil Gabryjelski Date: Fri, 8 Jan 2021 20:55:10 +0100 Subject: [PATCH] Fix running query on every change in chart controls --- .../src/explore/components/ExploreViewContainer.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/explore/components/ExploreViewContainer.jsx b/superset-frontend/src/explore/components/ExploreViewContainer.jsx index 0104ee29cf186..62d9d370dfea6 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer.jsx @@ -265,7 +265,6 @@ function ExploreViewContainer(props) { } }, [isDynamicPluginLoading]); - // effect to run when controls change useEffect(() => { const hasError = Object.values(props.controls).some( control => @@ -274,7 +273,10 @@ function ExploreViewContainer(props) { if (!hasError) { props.actions.triggerQuery(true, props.chart.id); } + }, []); + // effect to run when controls change + useEffect(() => { if (previousControls) { if (props.controls.viz_type.value !== previousControls.viz_type.value) { props.actions.resetControls();