fixed tab title recovery for split tabs - fixes #4810

This commit is contained in:
Eugene Pankov
2021-12-08 21:45:58 +01:00
parent b755346ac0
commit 433c7d33d9
5 changed files with 18 additions and 18 deletions

View File

@@ -108,13 +108,13 @@ export class AppRootComponent {
if (hotkey === 'move-tab-right') {
this.app.moveSelectedTabRight()
}
if (hotkey === 'reopen-tab') {
this.app.reopenLastTab()
}
if (hotkey === 'duplicate-tab') {
this.app.duplicateTab(this.app.activeTab)
}
}
if (hotkey === 'reopen-tab') {
this.app.reopenLastTab()
}
if (hotkey === 'toggle-fullscreen') {
hostWindow.toggleFullscreen()
}

View File

@@ -306,6 +306,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
async ngAfterViewInit (): Promise<void> {
if (this._recoveredState) {
await this.recoverContainer(this.root, this._recoveredState, this._recoveredState.duplicate)
this.updateTitle()
this.layout()
setTimeout(() => {
if (this.hasFocus) {

View File

@@ -102,13 +102,6 @@ export class AppService {
})
hostWindow.windowFocused$.subscribe(() => this._activeTab?.emitFocused())
this.tabClosed$.subscribe(async tab => {
const token = await tabRecovery.getFullRecoveryToken(tab)
if (token) {
this.closedTabsStack.push(token)
}
})
}
addTabRaw (tab: BaseTabComponent, index: number|null = null): void {
@@ -317,6 +310,10 @@ export class AppService {
if (checkCanClose && !await tab.canClose()) {
return
}
const token = await this.tabRecovery.getFullRecoveryToken(tab)
if (token) {
this.closedTabsStack.push(token)
}
tab.destroy()
}