2021-06-29 23:57:04 +02:00

22 lines
516 B
TypeScript

import { Injectable } from '@angular/core'
import { HostAppService } from './api/hostApp'
import { CLIHandler, CLIEvent } from './api/cli'
@Injectable()
export class LastCLIHandler extends CLIHandler {
firstMatchOnly = true
priority = -999
constructor (private hostApp: HostAppService) {
super()
}
async handle (event: CLIEvent): Promise<boolean> {
if (event.secondInstance) {
this.hostApp.newWindow()
return true
}
return false
}
}