mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 05:54:57 +00:00
22 lines
696 B
TypeScript
22 lines
696 B
TypeScript
import { Injectable } from '@angular/core'
|
|
import { TabRecoveryProvider, RecoveredTab, RecoveryToken } from 'terminus-core'
|
|
|
|
import { SerialTabComponent } from './components/serialTab.component'
|
|
|
|
/** @hidden */
|
|
@Injectable()
|
|
export class RecoveryProvider extends TabRecoveryProvider {
|
|
async recover (recoveryToken: RecoveryToken): Promise<RecoveredTab|null> {
|
|
if (recoveryToken.type === 'app:serial-tab') {
|
|
return {
|
|
type: SerialTabComponent,
|
|
options: {
|
|
connection: recoveryToken.connection,
|
|
savedState: recoveryToken.savedState,
|
|
},
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
}
|