ktmud commented on a change in pull request #10264:
URL:
https://github.com/apache/incubator-superset/pull/10264#discussion_r451920042
##########
File path: superset-frontend/src/explore/controlUtils.js
##########
@@ -121,19 +123,31 @@ function handleMissingChoice(control) {
return control;
}
-export function getControlStateFromControlConfig(controlConfig, state, value) {
+export function getControlStateFromControlConfig(
+ controlConfig,
+ controlPanelState,
+ value,
+) {
// skip invalid config values
if (!controlConfig) {
return null;
}
- const controlState = applyMapStateToPropsToControl(
- { ...controlConfig },
- state,
- );
+ const controlState = { ...controlConfig };
+ // only apply mapStateToProps when control states have been initialized
+ if (controlPanelState.controls || !controlPanelState.isInitializing) {
+ applyMapStateToPropsToControl(controlState, controlPanelState);
+ }
Review comment:
I've changed it to use `let`. Not a big fan of having many variables.
Always struggled with variable names and it quickly becomes confusing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]