1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-27 00:50:49 +03:00

restore tab colors during recovery (fixes #1713)

This commit is contained in:
Eugene Pankov 2020-02-05 13:58:18 +03:00
parent bfb6417865
commit ceb75323fe

View File

@ -21,7 +21,16 @@ export class TabRecoveryService {
window.localStorage.tabsRecovery = JSON.stringify(
await Promise.all(
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)
)
)
@ -31,7 +40,9 @@ export class TabRecoveryService {
for (const provider of this.config.enabledServices(this.tabRecoveryProviders)) {
try {
const tab = await provider.recover(token)
if (tab) {
if (tab !== null) {
tab.options = tab.options || {}
tab.options.color = token.tabColor || null
return tab
}
} catch (error) {