mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-30 16:29:53 +00:00
restore tab colors during recovery (fixes #1713)
This commit is contained in:
parent
bfb6417865
commit
ceb75323fe
@ -21,7 +21,16 @@ export class TabRecoveryService {
|
|||||||
window.localStorage.tabsRecovery = JSON.stringify(
|
window.localStorage.tabsRecovery = JSON.stringify(
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
tabs
|
tabs
|
||||||
.map(tab => tab.getRecoveryToken())
|
.map(tab => {
|
||||||
|
let token = tab.getRecoveryToken()
|
||||||
|
if (token) {
|
||||||
|
token = token.then(r => {
|
||||||
|
r.tabColor = tab.color
|
||||||
|
return r
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return token
|
||||||
|
})
|
||||||
.filter(token => !!token)
|
.filter(token => !!token)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -31,7 +40,9 @@ export class TabRecoveryService {
|
|||||||
for (const provider of this.config.enabledServices(this.tabRecoveryProviders)) {
|
for (const provider of this.config.enabledServices(this.tabRecoveryProviders)) {
|
||||||
try {
|
try {
|
||||||
const tab = await provider.recover(token)
|
const tab = await provider.recover(token)
|
||||||
if (tab) {
|
if (tab !== null) {
|
||||||
|
tab.options = tab.options || {}
|
||||||
|
tab.options.color = token.tabColor || null
|
||||||
return tab
|
return tab
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user