Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyMakesThings committed Feb 12, 2024
1 parent f522203 commit 6197435
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions core/field_variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,9 @@ Blockly.FieldVariable.prototype.initModel = function() {
return; // Initialization already happened.
}
this.workspace_ = this.sourceBlock_.workspace;

var variables = this.workspace_.getVariablesOfType(this.defaultType_);
variables = variables.sort(Blockly.VariableModel.compareByName);
var variable = Blockly.Variables.getVariable(this.workspace_, this.defaultVariableName, null, this.defaultType_);

// Initialize this field if it's in a broadcast block in the flyout
if (this.workspace_.isFlyout && !variable && variables.length > 0) variable = variables[0];
if (variables.length < 1) {
var variable = this.initFlyoutBroadcast_(this.workspace_);
if (!variable) {
var variable = Blockly.Variables.getOrCreateVariablePackage(
this.workspace_, null, this.defaultVariableName, this.defaultType_);
}
Expand Down

0 comments on commit 6197435

Please sign in to comment.