import { Component , OnDestroy , OnInit } from '@angular/core' ; import { ConnectionService } from '../../../connect/connection.service' ; import { SessionTimeoutService } from '../../../auth/services/session-timeout.service' ; import { ReplaySubject } from 'rxjs' ; import { takeUntil } from 'rxjs/operators' ; @ Component ( { selector : 'cmdb-footer' , templateUrl : './footer.component.html' , styleUrls : [ './footer.component.scss' ] } ) export class FooterComponent implements OnInit , OnDestroy { private subscriber : ReplaySubject < void > = new ReplaySubject < void > ( ) ; public today : number = Date . now ( ) ; public docUrl : string = 'localhost' ; public timeout : string = '' ; public constructor ( private connectionService , private timeoutService ) { this . docUrl = `${ connectionService . currentConnection }/docs` ; } public ngOnInit ( ) { this . timeoutService . sessionTimeoutRemaining . asObservable ( ) . pipe ( takeUntil ( this . subscriber ) ) . subscribe ( ( timeout ) => { this . timeout = timeout ; } ) ; } public ngOnDestroy ( ) { this . subscriber . next ( ) ; this . subscriber . complete ( ) ; } }