import { Component , OnInit } from '@angular/core' ; import { AuthService } from '@services/auth.service' ; import { GameService } from '@services/game.service' ; import { SettingsService } from '@services/settings.service' ; import { TabGameService } from '@services/tab-game.service' ; import { WindowService } from '@services/window.service' ; import { IpcRendererService } from "@services/electron/ipcrenderer.service" ; import { ApplicationService } from "@services/electron/application.service" ; import { ElectronService as electron } from '@services/electron/electron.service' ; @ Component ( { selector : 'app-main-component' , templateUrl : './main.component.html' , styleUrls : [ './main.component.scss' ] } ) export class MainComponent implements OnInit { constructor ( private windowService , public tabGameService , public gameService , private ipcRendererService , private settingsService , private applicationService , public authService ) { this . windowService . window . appVersion = applicationService . remoteAppVersion ; this . windowService . window . buildVersion = applicationService . remoteBuildVersion ; this . windowService . window . lindoVersion = applicationService . version ; } ngOnInit ( ) { this . setEventListener ( ) ; } removeTabGameByMiddleClick ( $event , tabId ) { if ( $event . which === 2 ) { this . tabGameService . removeTabGame ( tabId ) ; $event . preventDefault ( ) ; } } setEventListener ( ) { this . ipcRendererService . on ( 'accounts' , ( event , accounts ) => { this . tabGameService . addMultiAccountGames ( accounts ) ; } ) ; const window = electron . getCurrentWindow ( ) ; window . webContents . on ( 'new-window' , ( $event , url ) => { $event . preventDefault ( ) ; electron . openExternal ( url ) ; } ) ; } }