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:
parent
8c73861962
commit
0faa5b8b81
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user