Skip to content

Commit

Permalink
fix(toolbox): fix toolbox component init issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget committed Apr 26, 2017
1 parent 926d644 commit 001cfa4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/lib/tool/toolbox/toolbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,16 @@ export class ToolboxComponent implements AfterViewInit, OnInit, OnDestroy {
private createComponent(tool) {
const selectedTool = this.selectedTool;

if (!this.viewInitialized || !tool) {
return;
}
if (!this.viewInitialized || !tool) { return; }

/* If the component is created already, simply update its options */
if (selectedTool && selectedTool.name === tool.name) {
if (this.component && selectedTool && selectedTool.name === tool.name) {
this.setOptions(tool.options);
return;
}

const toolCls = this.toolService.getToolClass(tool.name);
if (toolCls === undefined) {
return;
}
if (toolCls === undefined) { return; }

this.destroyComponent();

Expand Down

0 comments on commit 001cfa4

Please sign in to comment.