mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make loadOnClusterRenderer arrow function again, revert autoInitExtensions change as unnecessary
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
parent
747f91ae36
commit
683515b7d7
@ -270,7 +270,7 @@ export class ExtensionLoader {
|
||||
});
|
||||
};
|
||||
|
||||
loadOnClusterRenderer(getCluster: () => KubernetesCluster) {
|
||||
loadOnClusterRenderer = (getCluster: () => KubernetesCluster) => {
|
||||
logger.debug(`${logModule}: load on cluster renderer (dashboard)`);
|
||||
|
||||
this.autoInitExtensions(async (extension: LensRendererExtension) => {
|
||||
@ -298,7 +298,7 @@ export class ExtensionLoader {
|
||||
|
||||
return removeItems;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
protected async loadExtensions(installedExtensions: Map<string, InstalledExtension>, register: (ext: LensExtension) => Promise<Disposer[]>) {
|
||||
// Steps of the function:
|
||||
@ -364,13 +364,13 @@ export class ExtensionLoader {
|
||||
});
|
||||
}
|
||||
|
||||
protected autoInitExtensions = (register: (ext: LensExtension) => Promise<Disposer[]>) => {
|
||||
protected autoInitExtensions(register: (ext: LensExtension) => Promise<Disposer[]>) {
|
||||
// Setup reaction to load extensions on JSON changes
|
||||
reaction(() => this.toJSON(), installedExtensions => this.loadExtensions(installedExtensions, register));
|
||||
|
||||
// Load initial extensions
|
||||
return this.loadExtensions(this.toJSON(), register);
|
||||
};
|
||||
}
|
||||
|
||||
protected requireExtension(extension: InstalledExtension): LensExtensionConstructor | null {
|
||||
const entryPointName = ipcRenderer ? "renderer" : "main";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user