| @@ -23,7 +23,7 @@ export class OverallGroundComponent implements OnInit, OnDestroy { | |||
| private statusSubscription?: Subscription; | |||
| private messageSubscription?: Subscription; | |||
| private intervalId: any; | |||
| isShowingToastr: boolean = false; | |||
| constructor( | |||
| private socketService$: SocketService, | |||
| @@ -92,10 +92,21 @@ export class OverallGroundComponent implements OnInit, OnDestroy { | |||
| this.Sstate1 = this.state1 === 'ON';// alarm 12h | |||
| this.Sstate2 = this.state2 === 'ON';// alarm 1h | |||
| if (message.ready === '0'){ | |||
| this.toastr.warning('System not ready', 'Warning', {timeOut: 5000}); | |||
| } | |||
| this.handleMessage(message); | |||
| } | |||
| } | |||
| handleMessage(message: any) { | |||
| if (message.ready === '0' && !this.isShowingToastr) { | |||
| this.showToastr(); | |||
| } | |||
| } | |||
| showToastr() { | |||
| this.toastr.warning('System not ready', 'Warning', { timeOut: 5000 }); | |||
| this.isShowingToastr = true; | |||
| setTimeout(() => { | |||
| this.isShowingToastr = false; | |||
| }, 5000); | |||
| } | |||
| } | |||