From 274a3c7cbd47ca59ffc038767e3c688630aa9057 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 13 Jun 2023 12:51:12 +0200 Subject: [PATCH] loading engine --- apps/remixdesktop/src/main.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/remixdesktop/src/main.ts b/apps/remixdesktop/src/main.ts index 37ec88e352..421de7eb7d 100644 --- a/apps/remixdesktop/src/main.ts +++ b/apps/remixdesktop/src/main.ts @@ -14,7 +14,7 @@ if ( } export let mainWindow: BrowserWindow; -export const createWindow = (): void => { +export const createWindow = async (): Promise => { // Create the browser window. mainWindow = new BrowserWindow({ height: 800, @@ -30,15 +30,19 @@ export const createWindow = (): void => { 'http://localhost:8080') mainWindow.maximize(); + // Open the DevTools. mainWindow.webContents.openDevTools(); - require('./engine') + }; // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. -app.on('ready', createWindow); +app.on('ready', async() => { + await createWindow(); + require('./engine') +}); // Quit when all windows are closed, except on macOS. There, it's common // for applications and their menu bar to stay active until the user quits