1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-26 12:03:31 +03:00
tabby/terminus-terminal/recoveryProvider.ts
Eugene Pankov 0ea346a6ae wip
2017-04-11 02:22:48 +02:00

27 lines
765 B
TypeScript

import { Injectable } from '@angular/core'
import { TabRecoveryProvider, AppService } from 'terminus-core'
import { SessionsService } from './services/sessions'
import { TerminalTabComponent } from './components/terminalTab'
@Injectable()
export class RecoveryProvider extends TabRecoveryProvider {
constructor (
private sessions: SessionsService,
private app: AppService,
) {
super()
}
async recover (recoveryToken: any): Promise<void> {
if (recoveryToken.type == 'app:terminal') {
let session = await this.sessions.recover(recoveryToken.recoveryId)
if (!session) {
return
}
this.app.openNewTab(TerminalTabComponent, { session })
}
}
}