1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Resolve extension enabled status when loading it

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-11-23 14:07:09 +02:00
parent 8c73861962
commit 0faa5b8b81
2 changed files with 2 additions and 5 deletions

View File

@ -6,6 +6,7 @@ import child_process from "child_process";
import logger from "../main/logger";
import { extensionPackagesRoot } from "./extension-loader";
import { getBundledExtensions } from "../common/utils/app-version";
import { extensionsStore } from "./extensions-store";
export interface InstalledExtension {
readonly manifest: LensExtensionManifest;
@ -160,6 +161,7 @@ export class ExtensionManager {
const manifestPath = path.resolve(absPath, "package.json");
const ext = await this.getByManifest(manifestPath).catch(() => null);
if (ext) {
ext.isEnabled = extensionsStore.isEnabled(ext.manifestPath);
extensions.push(ext);
}
}

View File

@ -34,11 +34,6 @@ export class ExtensionsStore extends BaseStore<LensExtensionsStoreModel> {
await extensionLoader.whenLoaded;
await this.whenLoaded;
// activate user-extensions when state is ready
extensionLoader.userExtensions.forEach((ext, extId) => {
ext.isEnabled = this.isEnabled(extId);
});
// apply state on changes from store
reaction(() => this.state.toJS(), extensionsState => {
extensionsState.forEach((state, extId) => {