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:
parent
11dce16b6c
commit
b6f6094e3e
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@ -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[]> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user