Skip to content

Commit 8a578f5

Browse files
authored
fix: Allow overriding VariableModel via options.plugins. (#9257)
1 parent c661dd1 commit 8a578f5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

core/registry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ export class Type<_T> {
119119
/** @internal */
120120
static PASTER = new Type<IPaster<ICopyData, ICopyable<ICopyData>>>('paster');
121121

122-
static VARIABLE_MODEL = new Type<IVariableModelStatic<IVariableState>>(
123-
'variableModel',
124-
);
122+
static VARIABLE_MODEL = new Type<
123+
IVariableModelStatic<IVariableState> & IVariableModel<IVariableState>
124+
>('variableModel');
125125

126126
static VARIABLE_MAP = new Type<IVariableMap<IVariableModel<IVariableState>>>(
127127
'variableMap',

core/variable_map.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ export class VariableMap
255255
}
256256
const id = opt_id || idGenerator.genUid();
257257
const type = opt_type || '';
258-
const VariableModel = registry.getObject(
258+
const VariableModel = registry.getClassFromOptions(
259259
registry.Type.VARIABLE_MODEL,
260-
registry.DEFAULT,
260+
this.workspace.options,
261261
true,
262262
);
263263
if (!VariableModel) {

0 commit comments

Comments
 (0)