mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-21 20:09:53 +00:00
duplicate tab title and color when duplicating a tab - fixes #3588
This commit is contained in:
parent
6236ee95c3
commit
62a21b03ea
@ -100,7 +100,7 @@ export class AppService {
|
||||
hostApp.windowFocused$.subscribe(() => this._activeTab?.emitFocused())
|
||||
|
||||
this.tabClosed$.subscribe(async tab => {
|
||||
const token = await tab.getRecoveryToken()
|
||||
const token = await tabRecovery.getFullRecoveryToken(tab)
|
||||
if (token) {
|
||||
this.closedTabsStack.push(token)
|
||||
}
|
||||
|
@ -24,20 +24,22 @@ export class TabRecoveryService {
|
||||
}
|
||||
window.localStorage.tabsRecovery = JSON.stringify(
|
||||
(await Promise.all(
|
||||
tabs
|
||||
.map(async tab => tab.getRecoveryToken().then(r => {
|
||||
if (r) {
|
||||
r.tabTitle = tab.title
|
||||
if (tab.color) {
|
||||
r.tabColor = tab.color
|
||||
}
|
||||
}
|
||||
return r
|
||||
}))
|
||||
tabs.map(async tab => this.getFullRecoveryToken(tab))
|
||||
)).filter(token => !!token)
|
||||
)
|
||||
}
|
||||
|
||||
async getFullRecoveryToken (tab: BaseTabComponent): Promise<RecoveryToken|null> {
|
||||
const token = await tab.getRecoveryToken()
|
||||
if (token) {
|
||||
token.tabTitle = tab.title
|
||||
if (tab.color) {
|
||||
token.tabColor = tab.color
|
||||
}
|
||||
}
|
||||
return token
|
||||
}
|
||||
|
||||
async recoverTab (token: RecoveryToken): Promise<RecoveredTab|null> {
|
||||
for (const provider of this.config.enabledServices(this.tabRecoveryProviders ?? [])) {
|
||||
try {
|
||||
|
@ -30,7 +30,7 @@ export class TabsService {
|
||||
* Duplicates an existing tab instance (using the tab recovery system)
|
||||
*/
|
||||
async duplicate (tab: BaseTabComponent): Promise<BaseTabComponent|null> {
|
||||
const token = await tab.getRecoveryToken()
|
||||
const token = await this.tabRecovery.getFullRecoveryToken(tab)
|
||||
if (!token) {
|
||||
return null
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user