mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-05 22:44:55 +00:00
simpler tab recovery system
This commit is contained in:
@@ -19,13 +19,18 @@ export class TabRecoveryService {
|
||||
app.tabsChanged$.subscribe(() => {
|
||||
this.saveTabs(app.tabs)
|
||||
})
|
||||
setInterval(() => {
|
||||
this.saveTabs(app.tabs)
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
saveTabs (tabs: BaseTabComponent[]) {
|
||||
async saveTabs (tabs: BaseTabComponent[]) {
|
||||
window.localStorage.tabsRecovery = JSON.stringify(
|
||||
tabs
|
||||
.map((tab) => tab.getRecoveryToken())
|
||||
.filter((token) => !!token)
|
||||
await Promise.all(
|
||||
tabs
|
||||
.map(tab => tab.getRecoveryToken())
|
||||
.filter(token => !!token)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user