diff --git a/desktop/src/app/alignment/alignment.component.ts b/desktop/src/app/alignment/alignment.component.ts index a7f47fd87..b550a9735 100644 --- a/desktop/src/app/alignment/alignment.component.ts +++ b/desktop/src/app/alignment/alignment.component.ts @@ -49,6 +49,19 @@ export class AlignmentComponent implements AfterViewInit, OnDestroy { } }) + electron.on('GUIDE_OUTPUT_ATTACHED', (_, event: GuideOutput) => { + ngZone.run(() => { + this.guideOutputs.push(event) + }) + }) + + electron.on('GUIDE_OUTPUT_DETACHED', (_, event: GuideOutput) => { + ngZone.run(() => { + const index = this.guideOutputs.findIndex(e => e.name === event.name) + if (index >= 0) this.guideOutputs.splice(index, 1) + }) + }) + electron.on('GUIDE_OUTPUT_UPDATED', (_, event: GuideOutput) => { if (event.name === this.guideOutput?.name) { ngZone.run(() => { diff --git a/desktop/src/app/guider/guider.component.ts b/desktop/src/app/guider/guider.component.ts index ebd3023be..929b4425b 100644 --- a/desktop/src/app/guider/guider.component.ts +++ b/desktop/src/app/guider/guider.component.ts @@ -243,7 +243,7 @@ export class GuiderComponent implements AfterViewInit, OnDestroy { electron.on('GUIDE_OUTPUT_DETACHED', (_, event: GuideOutput) => { ngZone.run(() => { const index = this.guideOutputs.findIndex(e => e.name === event.name) - if (index) this.guideOutputs.splice(index, 1) + if (index >= 0) this.guideOutputs.splice(index, 1) }) })