Fix rename variable bug by always passing additionalVars to the scratch-blocks prompt callback. Let scratch-blocks decide whether or not to use the additional vars based on whether the variable is local or global.

This commit is contained in:
Karishma Chadha committed 2018-07-12 19:21:54 -04:00
1 parent 4fc8a0d1a6
commit f3a2d53332
1 file changed
+4 -3
+4 -3
View File
@@ -366,9 +366,10 @@ class Blocks extends React.Component {
this.ScratchBlocks.refreshStatusButtons(this.workspace);
}
handlePromptCallback (input, optionSelection) {
this.state.prompt.callback(input, optionSelection,
(optionSelection === 'local') ? [] :
this.props.vm.runtime.getAllVarNamesOfType(this.state.prompt.varType));
this.state.prompt.callback(
input,
this.props.vm.runtime.getAllVarNamesOfType(this.state.prompt.varType),
optionSelection);
this.handlePromptClose();
}
handlePromptClose () {