mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-05 22:44:55 +00:00
split tab recovery (#49)
This commit is contained in:
@@ -68,11 +68,9 @@ export class AppService {
|
||||
|
||||
this.hostApp.windowCloseRequest$.subscribe(() => this.closeWindow())
|
||||
|
||||
/*this.tabRecovery.recoverTabs().then(tabs => {
|
||||
for (let
|
||||
this.openNewTab(tab.type, tab.options)
|
||||
tab of tabs) {
|
||||
this.openNewTab(tab.type, tab.options)
|
||||
this.tabRecovery.recoverTabs().then(tabs => {
|
||||
for (let tab of tabs) {
|
||||
this.openNewTabRaw(tab.type, tab.options)
|
||||
}
|
||||
|
||||
this.tabsChanged$.subscribe(() => {
|
||||
@@ -81,7 +79,7 @@ export class AppService {
|
||||
setInterval(() => {
|
||||
tabRecovery.saveTabs(this.tabs)
|
||||
}, 30000)
|
||||
})*/
|
||||
})
|
||||
}
|
||||
|
||||
addTabRaw (tab: BaseTabComponent) {
|
||||
@@ -90,6 +88,10 @@ export class AppService {
|
||||
this.tabsChanged.next()
|
||||
this.tabOpened.next(tab)
|
||||
|
||||
tab.recoveryStateChangedHint$.subscribe(() => {
|
||||
this.tabRecovery.saveTabs(this.tabs)
|
||||
})
|
||||
|
||||
tab.titleChange$.subscribe(title => {
|
||||
if (tab === this.activeTab) {
|
||||
this.hostApp.setTitle(title)
|
||||
|
@@ -10,9 +10,7 @@ export class TabsService {
|
||||
private componentFactoryResolver: ComponentFactoryResolver,
|
||||
private injector: Injector,
|
||||
private tabRecovery: TabRecoveryService,
|
||||
) {
|
||||
|
||||
}
|
||||
) { }
|
||||
|
||||
create (type: TabComponentType, inputs?: any): BaseTabComponent {
|
||||
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(type)
|
||||
|
Reference in New Issue
Block a user