Skip to content

Commit

Permalink
feat: fix editor theme load
Browse files Browse the repository at this point in the history
  • Loading branch information
Hachi-R committed Jan 30, 2025
1 parent f542b2d commit e49a321
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/services/window-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]) {
Expand All @@ -231,16 +225,18 @@ export class WindowManager {
);
} else {
editorWindow.loadFile(path.join(__dirname, "../renderer/index.html"), {
hash: "editor",
hash: `editor?themeId=${themeId}`,
});
}

editorWindow.once("ready-to-show", () => {
editorWindow.show();
});

WindowManager.mainWindow?.webContents.openDevTools();

editorWindow.on("close", () => {
this.mainWindow?.webContents.closeDevTools();
WindowManager.mainWindow?.webContents.closeDevTools();
});
}
}
Expand Down

0 comments on commit e49a321

Please sign in to comment.