diff --git a/ui-ngx/src/app/shared/components/led-light.component.ts b/ui-ngx/src/app/shared/components/led-light.component.ts index 089b8d1661..35e65c7771 100644 --- a/ui-ngx/src/app/shared/components/led-light.component.ts +++ b/ui-ngx/src/app/shared/components/led-light.component.ts @@ -85,11 +85,11 @@ export class LedLightComponent implements OnInit, AfterViewInit, OnChanges { this.canvasSize = this.size; this.radius = this.canvasSize / 4; this.glowSize = this.radius / 5; - if (this.paper) { - this.paper.remove(); - } import('raphael').then( (raphael) => { + if (this.paper) { + this.paper.remove(); + } this.paper = raphael.default($('#canvas_container', this.elementRef.nativeElement)[0], this.canvasSize, this.canvasSize); const center = this.canvasSize / 2; this.circleElement = this.paper.circle(center, center, this.radius);