import { Component , OnInit } from 'angular-ts-decorators' ; import autobind from 'autobind-decorator' ; import Globals from '../../shared/global-shared.constants' ; import { PlatformService } from '../../shared/global-shared.interface' ; import { StoreKey } from '../../shared/store/store.enum' ; import { StoreService } from '../../shared/store/store.service' ; import { UtilityService } from '../../shared/utility/utility.service' ; import { RoutePath } from '../app.enum' ; import { AppHelperService } from '../shared/app-helper/app-helper.service' ; @ autobind @ Component ( { controllerAs : 'vm' , selector : 'appUpdated' , styles : [ require ( './app-updated.component.scss' ) ] , template : require ( './app-updated.component.html' ) } ) export class AppUpdatedComponent implements OnInit { Strings = require ( '../../../../res/strings/en.json' ) ; $timeout : ng . ITimeoutService ; appHelperSvc : AppHelperService ; platformSvc : PlatformService ; storeSvc : StoreService ; utilitySvc : UtilityService ; appVersion : string ; releaseNotesUrl : string ; static $inject = [ '$timeout' , 'AppHelperService' , 'PlatformService' , 'StoreService' , 'UtilityService' ] ; constructor ( $timeout , AppHelperSvc , PlatformSvc , StoreSvc , UtilitySvc ) { this . $timeout = $timeout ; this . appHelperSvc = AppHelperSvc ; this . platformSvc = PlatformSvc ; this . storeSvc = StoreSvc ; this . utilitySvc = UtilitySvc ; } close ( event ? ) { event ?. preventDefault ( ) ; this . storeSvc . set ( StoreKey . DisplayUpdated , false ) ; this . appHelperSvc . switchView ( RoutePath . Support ) ; } displayReleaseNotes ( ) { this . appHelperSvc . openUrl ( null , this . releaseNotesUrl ) ; } ngOnInit ( ) { this . platformSvc . getAppVersionName ( ) . then ( ( appVersion ) => { this . appVersion = appVersion ; this . releaseNotesUrl = `${ Globals . ReleaseNotesUrlStem }${ appVersion }` ; } ) ; this . appHelperSvc . focusOnElement ( '.focused' ) ; this . appHelperSvc . attachClickEventsToNewTabLinks ( ) ; } }