mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Use CLOUD_PREFIX.length instead of assuming it
This commit is contained in:
parent
799c7bd748
commit
273d5c2f7e
1 changed files with 2 additions and 2 deletions
|
@ -496,8 +496,8 @@ Blockly.Variables.renameVariable = function(workspace, variable,
|
|||
Blockly.prompt(promptText, promptDefaultText,
|
||||
function(newName, additionalVars) {
|
||||
if (variable.isCloud &&
|
||||
newName.length > 0 && newName.indexOf(Blockly.Variables.CLOUD_PREFIX) == 0 ) {
|
||||
newName = newName.substring(2); // The name validator will add the prefix back
|
||||
newName.length > 0 && newName.indexOf(Blockly.Variables.CLOUD_PREFIX) == 0) {
|
||||
newName = newName.substring(Blockly.Variables.CLOUD_PREFIX.length); // The name validator will add the prefix back
|
||||
}
|
||||
additionalVars = additionalVars || [];
|
||||
var additionalVarNames = variable.isLocal ? [] : additionalVars;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue