refactor: Use IVariableModel instead of VariableModel. (#8400)

* refactor: Use IVariableModel methods instead of directly accessing properties.

* refactor: replace references to VariableModel with IVariableModel.
This commit is contained in:
Aaron Dodson
2024-07-19 14:58:04 -07:00
committed by GitHub
parent 02e64bebbe
commit 294ef74d1b
22 changed files with 248 additions and 141 deletions

View File

@@ -9,7 +9,6 @@
import {Blocks} from './blocks.js';
import {Msg} from './msg.js';
import * as xml from './utils/xml.js';
import {VariableModel} from './variable_model.js';
import * as Variables from './variables.js';
import type {Workspace} from './workspace.js';
import type {WorkspaceSvg} from './workspace_svg.js';
@@ -129,7 +128,7 @@ export function flyoutCategoryBlocks(workspace: Workspace): Element[] {
xmlList.push(block);
}
if (Blocks['variables_get_dynamic']) {
variableModelList.sort(VariableModel.compareByName);
variableModelList.sort(Variables.compareByName);
for (let i = 0, variable; (variable = variableModelList[i]); i++) {
const block = xml.createElement('block');
block.setAttribute('type', 'variables_get_dynamic');