From f3a2d533326a84142f0ab3fb2994b09f9db2e822 Mon Sep 17 00:00:00 2001 From: Karishma Chadha <kchadha@scratch.mit.edu> Date: Thu, 12 Jul 2018 19:14:09 -0400 Subject: [PATCH] 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. --- src/containers/blocks.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx index c81c5d21a..1de665e33 100644 --- a/src/containers/blocks.jsx +++ b/src/containers/blocks.jsx @@ -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 () { -- GitLab