1
0
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:
Roman 2021-03-09 20:04:42 +02:00
parent be3bd7937e
commit 25e5122a3f

View File

@ -24,7 +24,7 @@ export class DockTabStore<T = any> {
this.storage = createStorage(storageKey, {});
await this.storage.whenReady;
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
@ -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 { storageSerializer } = this.options;
@ -68,5 +68,6 @@ export class DockTabStore<T = any> {
reset() {
this.data.clear();
this.storage?.clear();
}
}