split tab recovery (#49)

This commit is contained in:
Eugene Pankov
2019-03-03 23:51:25 +01:00
parent 70b463b086
commit 7279ba13ac
5 changed files with 103 additions and 17 deletions

View File

@@ -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)

View File

@@ -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)