Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
perf: avoid transferring libs multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Sep 10, 2018
1 parent 9cb754e commit 471da85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/model/element/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ export class Element {
return this.open;
}

public getPage(): Page | undefined {
return this.page;
}

public getParent(): Element | undefined {
const container = this.getContainer();

Expand Down
5 changes: 4 additions & 1 deletion src/server/create-preview-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ export function createPreviewRoute(options: PreviewRouteOptions): Express.Reques
return;
}

const clone = Model.Project.from(project.toJSON());
clone.getPatternLibraries().map(l => l.setBundle(''));

res.send(
PreviewDocument.previewDocument({
data: project.toJSON(),
data: clone.toJSON(),
scripts: project
.getPatternLibraries()
.map(
Expand Down

0 comments on commit 471da85

Please sign in to comment.