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

fix extensionLoader error on dev environments where renderer might start early (#1447)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-11-19 16:11:58 +02:00 committed by GitHub
parent 5589a99e7e
commit d60eee20cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -34,10 +34,7 @@ export class ExtensionLoader {
}
@action
async init(extensions?: Map<LensExtensionId, InstalledExtension>) {
if (extensions) {
this.extensions.replace(extensions);
}
async init() {
if (ipcRenderer) {
this.initRenderer()
} else {
@ -46,6 +43,10 @@ export class ExtensionLoader {
extensionsStore.manageState(this);
}
initExtensions(extensions?: Map<LensExtensionId, InstalledExtension>) {
this.extensions.replace(extensions)
}
protected async initMain() {
this.isLoaded = true;
this.loadOnMain();

View File

@ -78,8 +78,9 @@ app.on("ready", async () => {
app.exit();
}
extensionLoader.init()
windowManager = WindowManager.getInstance<WindowManager>(proxyPort);
extensionLoader.init(await extensionManager.load()); // call after windowManager to see splash earlier
extensionLoader.initExtensions(await extensionManager.load()); // call after windowManager to see splash earlier
setTimeout(() => {
appEventBus.emit({ name: "service", action: "start" })