Skip to content

Commit

Permalink
don't connect during print (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
UnchartedBull committed Mar 31, 2020
1 parent c3ea39a commit 024d580
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/standby/standby.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ 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();
} else {
this.connectionRetries--;
setTimeout(this.connectToPrinter.bind(this), 500);
}
} else if (data.current.state === 'Error') {
this.connectionRetries = 3;
this.setConnectionError();
} else {
this.disableStandby();
}
Expand Down

0 comments on commit 024d580

Please sign in to comment.