Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(explore): Don't run a query on every change in chart controls #12361

Merged
merged 1 commit into from
Jan 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ function ExploreViewContainer(props) {
}
}, [isDynamicPluginLoading]);

// effect to run when controls change
useEffect(() => {
const hasError = Object.values(props.controls).some(
control =>
Expand All @@ -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();
Expand Down