tabby/terminus-terminal/src/recoveryProvider.ts
2019-03-07 02:05:26 +01:00

18 lines
604 B
TypeScript

import { Injectable } from '@angular/core'
import { TabRecoveryProvider, RecoveredTab } from 'terminus-core'
import { TerminalTabComponent } from './components/terminalTab.component'
/** @hidden */
@Injectable()
export class RecoveryProvider extends TabRecoveryProvider {
async recover (recoveryToken: any): Promise<RecoveredTab> {
if (recoveryToken && recoveryToken.type === 'app:terminal-tab') {
return {
type: TerminalTabComponent,
options: { sessionOptions: recoveryToken.sessionOptions },
}
}
return null
}
}