mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
extension-store sync fix
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
f1f9a364e2
commit
1c5c394637
@ -9,7 +9,7 @@ import logger from "../main/logger";
|
|||||||
|
|
||||||
export interface ExtensionStoreModel {
|
export interface ExtensionStoreModel {
|
||||||
version: ExtensionVersion;
|
version: ExtensionVersion;
|
||||||
extensions: Record<ExtensionId, ExtensionModel>
|
extensions: [ExtensionId, ExtensionModel][]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExtensionModel {
|
export interface ExtensionModel {
|
||||||
@ -35,7 +35,6 @@ export class ExtensionStore extends BaseStore<ExtensionStoreModel> {
|
|||||||
private constructor() {
|
private constructor() {
|
||||||
super({
|
super({
|
||||||
configName: "lens-extension-store",
|
configName: "lens-extension-store",
|
||||||
syncEnabled: false,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +130,7 @@ export class ExtensionStore extends BaseStore<ExtensionStoreModel> {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
if (extensions) {
|
if (extensions) {
|
||||||
const currentExtensions = new Map(Object.entries(extensions));
|
const currentExtensions = new Map(extensions);
|
||||||
this.extensions.forEach(extension => {
|
this.extensions.forEach(extension => {
|
||||||
if (!currentExtensions.has(extension.id)) {
|
if (!currentExtensions.has(extension.id)) {
|
||||||
this.removed.set(extension.id, extension);
|
this.removed.set(extension.id, extension);
|
||||||
@ -163,7 +162,7 @@ export class ExtensionStore extends BaseStore<ExtensionStoreModel> {
|
|||||||
toJSON(): ExtensionStoreModel {
|
toJSON(): ExtensionStoreModel {
|
||||||
return toJS({
|
return toJS({
|
||||||
version: this.version,
|
version: this.version,
|
||||||
extensions: this.extensions.toJSON(),
|
extensions: Array.from(this.extensions).map(([id, instance]) => [id, instance.toJSON()]),
|
||||||
}, {
|
}, {
|
||||||
recurseEverything: true,
|
recurseEverything: true,
|
||||||
})
|
})
|
||||||
|
|||||||
@ -87,7 +87,7 @@ export class LensExtension implements ExtensionModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toJSON(): ExtensionModel {
|
toJSON(): ExtensionModel {
|
||||||
return {
|
return toJS({
|
||||||
id: this.id,
|
id: this.id,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
version: this.version,
|
version: this.version,
|
||||||
@ -95,6 +95,8 @@ export class LensExtension implements ExtensionModel {
|
|||||||
manifestPath: this.manifestPath,
|
manifestPath: this.manifestPath,
|
||||||
enabled: this.isEnabled,
|
enabled: this.isEnabled,
|
||||||
updateUrl: this.updateUrl,
|
updateUrl: this.updateUrl,
|
||||||
}
|
}, {
|
||||||
|
recurseEverything: true,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user