import { Component , OnInit } from 'angular-ts-decorators' ; import autobind from 'autobind-decorator' ; import { PlatformService } from '../../shared/global-shared.interface' ; import { UtilityService } from '../../shared/utility/utility.service' ; import { AppEventType } from '../app.enum' ; import { AppHelperService } from '../shared/app-helper/app-helper.service' ; @ autobind @ Component ( { controllerAs : 'vm' , selector : 'appSettings' , styles : [ require ( './app-settings.component.scss' ) ] , template : require ( './app-settings.component.html' ) } ) export class AppSettingsComponent implements OnInit { Strings = require ( '../../../../res/strings/en.json' ) ; $timeout : ng . ITimeoutService ; appHelperSvc : AppHelperService ; platformSvc : PlatformService ; utilitySvc : UtilityService ; syncEnabled : boolean ; static $inject = [ '$timeout' , 'AppHelperService' , 'PlatformService' , 'UtilityService' ] ; constructor ( $timeout , AppHelperSvc , PlatformSvc , UtilitySvc ) { this . $timeout = $timeout ; this . appHelperSvc = AppHelperSvc ; this . platformSvc = PlatformSvc ; this . utilitySvc = UtilitySvc ; } close ( ) { this . appHelperSvc . switchView ( ) ; } ngOnInit ( ) { this . utilitySvc . isSyncEnabled ( ) . then ( ( syncEnabled ) => { this . syncEnabled = syncEnabled ; this . appHelperSvc . attachClickEventsToNewTabLinks ( ) ; } ) ; } refreshSyncDataUsage ( ) { this . utilitySvc . broadcastEvent ( AppEventType . RefreshSyncDataUsage ) ; } }