Skip to content

Commit d7dba88

Browse files
LappiLapplandla
andauthored
fix: Fix creation of variables in the main workspace when opening flyout (#2686)
Co-authored-by: la <laper@as.co>
1 parent 46a2dd1 commit d7dba88

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

plugins/block-shareable-procedures/src/observable_parameter_model.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ export class ObservableParameterModel
7474
name: string,
7575
varId?: string,
7676
): Blockly.IVariableModel<Blockly.IVariableState> {
77-
this.variable =
78-
this.workspace.getVariable(name) ??
79-
this.workspace.createVariable(name, '', varId);
77+
this.variable = Blockly.Variables.getOrCreateVariablePackage(
78+
this.workspace,
79+
varId || null,
80+
name,
81+
'',
82+
);
8083
return this.variable;
8184
}
8285

0 commit comments

Comments
 (0)