From e49a32166a76b6168e218893f8e7db6fcf5ab981 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Thu, 30 Jan 2025 02:25:41 -0300 Subject: [PATCH] feat: fix editor theme load --- src/main/services/window-manager.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 9f5c5747..5f599e1b 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -217,12 +217,6 @@ export class WindowManager { show: false, }); - if (!app.isPackaged) { - editorWindow.webContents.openDevTools(); - } else { - this.mainWindow?.webContents.openDevTools(); - } - editorWindow.removeMenu(); if (is.dev && process.env["ELECTRON_RENDERER_URL"]) { @@ -231,7 +225,7 @@ export class WindowManager { ); } else { editorWindow.loadFile(path.join(__dirname, "../renderer/index.html"), { - hash: "editor", + hash: `editor?themeId=${themeId}`, }); } @@ -239,8 +233,10 @@ export class WindowManager { editorWindow.show(); }); + WindowManager.mainWindow?.webContents.openDevTools(); + editorWindow.on("close", () => { - this.mainWindow?.webContents.closeDevTools(); + WindowManager.mainWindow?.webContents.closeDevTools(); }); } }