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

extensions-api -- fix: activating extensions only in mainFrame (cluster-manager scope view)

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-09-04 16:19:19 +03:00
parent 11dce16b6c
commit b6f6094e3e
2 changed files with 8 additions and 11 deletions

View File

@ -6,11 +6,6 @@ import { LensExtension } from "@lens/extensions"; // fixme: map to generated typ
export default class ExampleExtension extends LensExtension {
async activate(): Promise<any> {
await super.activate();
console.warn('EXAMPLE EXTENSION: ACTIVATE'.padStart(10, "-"));
}
async deactivate(): Promise<any> {
console.warn('EXAMPLE EXTENSION: DEACTIVATE'.padStart(10, "-"))
await super.deactivate();
console.warn('EXAMPLE EXTENSION: ACTIVATE');
}
}

View File

@ -77,11 +77,13 @@ export class ExtensionStore extends BaseStore<ExtensionStoreModel> {
this.installed.replace(extensions.map(ext => [ext.manifestPath, ext]));
// todo: remove
extensions.forEach(({ extensionModule, manifest }) => {
const LensExtension = extensionModule.default;
const instance = new LensExtension({ ...manifest }, manifest);
instance.activate();
})
if (process.isMainFrame) {
extensions.forEach(({ extensionModule, manifest }) => {
const LensExtension = extensionModule.default;
const instance = new LensExtension({ ...manifest }, manifest);
instance.activate();
})
}
}
async loadExtensions(folderPath: string): Promise<InstalledExtension[]> {