Skip to content

Commit

Permalink
Remove unused variable in auto layouting command
Browse files Browse the repository at this point in the history
  • Loading branch information
hlxid committed Jan 28, 2024
1 parent cabff37 commit 4c01a61
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/features/autoLayout/command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { inject } from "inversify";
import { Command, CommandExecutionContext, LocalModelSource, SModelRootImpl, TYPES } from "sprotty";
import { Command, CommandExecutionContext, SModelRootImpl, TYPES } from "sprotty";
import { Action, IModelLayoutEngine, SGraph, SModelRoot } from "sprotty-protocol";
import { LoadDiagramCommand } from "../serialize/load";

Expand All @@ -22,16 +22,13 @@ export class LayoutModelCommand extends Command {
@inject(TYPES.IModelLayoutEngine)
private readonly layoutEngine?: IModelLayoutEngine;

@inject(TYPES.ModelSource)
private readonly modelSource?: LocalModelSource;

private oldModelSchema?: SModelRoot;
private newModel?: SModelRootImpl;

async execute(context: CommandExecutionContext): Promise<SModelRootImpl> {
this.oldModelSchema = context.modelFactory.createSchema(context.root);

if (!this.layoutEngine || !this.modelSource) throw new Error("Missing injects");
if (!this.layoutEngine) throw new Error("Missing injects");

// Layouting is normally done on the graph schema.
// This is not viable for us because the dfd nodes have a dynamically computed size.
Expand Down

0 comments on commit 4c01a61

Please sign in to comment.