From f798dabed055335558633c9988f5db85c6f20dd2 Mon Sep 17 00:00:00 2001 From: UnchartedBull Date: Tue, 31 Mar 2020 11:39:17 +0200 Subject: [PATCH] don't connect during print --- src/app/standby/standby.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/standby/standby.component.ts b/src/app/standby/standby.component.ts index ddcfb2eef..953b01302 100644 --- a/src/app/standby/standby.component.ts +++ b/src/app/standby/standby.component.ts @@ -59,7 +59,7 @@ export class StandbyComponent implements OnInit { private checkConnection(): void { this.http.get(this.configService.getURL('connection'), this.configService.getHTTPHeaders()).subscribe( (data: OctoprintConnectionAPI): void => { - if (data.current.state !== 'Operational') { + if (data.current.state === 'Closed') { if (this.connectionRetries === 0) { this.connectionRetries = 3; this.setConnectionError(); @@ -67,6 +67,9 @@ export class StandbyComponent implements OnInit { this.connectionRetries--; setTimeout(this.connectToPrinter.bind(this), 500); } + } else if (data.current.state === 'Error') { + this.connectionRetries = 3; + this.setConnectionError(); } else { this.disableStandby(); }