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 {
|
export default class ExampleExtension extends LensExtension {
|
||||||
async activate(): Promise<any> {
|
async activate(): Promise<any> {
|
||||||
await super.activate();
|
await super.activate();
|
||||||
console.warn('EXAMPLE EXTENSION: ACTIVATE'.padStart(10, "-"));
|
console.warn('EXAMPLE EXTENSION: ACTIVATE');
|
||||||
}
|
|
||||||
|
|
||||||
async deactivate(): Promise<any> {
|
|
||||||
console.warn('EXAMPLE EXTENSION: DEACTIVATE'.padStart(10, "-"))
|
|
||||||
await super.deactivate();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,11 +77,13 @@ export class ExtensionStore extends BaseStore<ExtensionStoreModel> {
|
|||||||
this.installed.replace(extensions.map(ext => [ext.manifestPath, ext]));
|
this.installed.replace(extensions.map(ext => [ext.manifestPath, ext]));
|
||||||
|
|
||||||
// todo: remove
|
// todo: remove
|
||||||
extensions.forEach(({ extensionModule, manifest }) => {
|
if (process.isMainFrame) {
|
||||||
const LensExtension = extensionModule.default;
|
extensions.forEach(({ extensionModule, manifest }) => {
|
||||||
const instance = new LensExtension({ ...manifest }, manifest);
|
const LensExtension = extensionModule.default;
|
||||||
instance.activate();
|
const instance = new LensExtension({ ...manifest }, manifest);
|
||||||
})
|
instance.activate();
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadExtensions(folderPath: string): Promise<InstalledExtension[]> {
|
async loadExtensions(folderPath: string): Promise<InstalledExtension[]> {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user