Skip to content

Commit

Permalink
fix: init workspace and viewNode
Browse files Browse the repository at this point in the history
  • Loading branch information
wwsun committed Jul 31, 2024
1 parent 31201b6 commit 6f27c61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/models/abstract-code-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export abstract class AbstractCodeWorkspace extends AbstractWorkspace {
super(options);
this.storeModules = {};
this.serviceModules = {};
if (options?.files) {
this.addFiles(options.files);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/models/abstract-view-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export abstract class AbstractViewNode<RawNodeType = unknown, ViewFileType = Abs
this.id = props.id;
this.component = props.component;
this.rawNode = props.rawNode;
this.file = null;
this.file = props.file;
}

/**
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/models/abstract-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ export abstract class AbstractWorkspace extends EventTarget {
this.onFilesChange = options.onFilesChange;
}

if (options?.files) {
this.addFiles(options.files);
}

if (options?.prototypes) {
this.setComponentPrototypes(options.prototypes);
}
Expand Down

0 comments on commit 6f27c61

Please sign in to comment.