potentially fixed #576

This commit is contained in:
Eugene Pankov
2018-12-29 13:27:45 +01:00
parent 92afec75e7
commit 8793613117
3 changed files with 22 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ export class HostAppService {
private cliOpenProfile = new Subject<string>()
private configChangeBroadcast = new Subject<void>()
private windowCloseRequest = new Subject<void>()
private windowMoved = new Subject<void>()
private logger: Logger
private windowId: number
@@ -41,6 +42,7 @@ export class HostAppService {
get cliOpenProfile$ (): Observable<string> { return this.cliOpenProfile }
get configChangeBroadcast$ (): Observable<void> { return this.configChangeBroadcast }
get windowCloseRequest$ (): Observable<void> { return this.windowCloseRequest }
get windowMoved$ (): Observable<void> { return this.windowMoved }
constructor (
private zone: NgZone,
@@ -80,6 +82,10 @@ export class HostAppService {
this.zone.run(() => this.windowCloseRequest.next())
})
electron.ipcRenderer.on('host:window-moved', () => {
this.zone.run(() => this.windowMoved.next())
})
electron.ipcRenderer.on('host:second-instance', (_$event, argv: any, cwd: string) => this.zone.run(() => {
this.logger.info('Second instance', argv)
const op = argv._[0]