File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/app/gateway/gateway-table Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export class GatewayTableComponent implements AfterViewInit {
4343
4444 faExclamationTriangle = faExclamationTriangle ;
4545 faCheckCircle = faCheckCircle ;
46-
46+ refetchIntervalId : NodeJS . Timeout ;
4747 batteryStatusColor = 'green' ;
4848 batteryStatusPercentage = 50 ;
4949 resultsLength = 0 ;
@@ -67,10 +67,14 @@ export class GatewayTableComponent implements AfterViewInit {
6767 this . organizationId = x ;
6868 this . refresh ( ) ;
6969 } ) ;
70-
70+ this . refetchIntervalId = setInterval ( ( ) => this . refresh ( ) , 60 * 1000 )
7171 this . refresh ( ) ;
7272 }
7373
74+ ngOnDestroy ( ) {
75+ clearInterval ( this . refetchIntervalId )
76+ }
77+
7478 private refresh ( ) {
7579 this . getGateways ( ) . subscribe ( ( data ) => {
7680 data . result . forEach ( ( gw ) => {
You can’t perform that action at this time.
0 commit comments