mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
added missing storage clean-up
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
be3bd7937e
commit
25e5122a3f
@ -24,7 +24,7 @@ export class DockTabStore<T = any> {
|
|||||||
this.storage = createStorage(storageKey, {});
|
this.storage = createStorage(storageKey, {});
|
||||||
await this.storage.whenReady;
|
await this.storage.whenReady;
|
||||||
this.data.replace(this.storage.get());
|
this.data.replace(this.storage.get());
|
||||||
reaction(() => this.serializeData(), data => this.storage.set(data));
|
reaction(() => this.serializeData(), (data: Record<TabId, T>) => this.storage.set(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear data for closed tabs
|
// clear data for closed tabs
|
||||||
@ -39,7 +39,7 @@ export class DockTabStore<T = any> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected serializeData(): Record<TabId, T> {
|
protected serializeData(): Record<TabId, Partial<T>> {
|
||||||
const data = this.data.toJSON();
|
const data = this.data.toJSON();
|
||||||
const { storageSerializer } = this.options;
|
const { storageSerializer } = this.options;
|
||||||
|
|
||||||
@ -68,5 +68,6 @@ export class DockTabStore<T = any> {
|
|||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.data.clear();
|
this.data.clear();
|
||||||
|
this.storage?.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user