Skip to content

Commit

Permalink
fix: dev tools
Browse files Browse the repository at this point in the history
  • Loading branch information
zamitto committed Feb 16, 2025
1 parent 0511cc0 commit 3271de0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/services/window-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,21 @@ export class WindowManager {

editorWindow.once("ready-to-show", () => {
editorWindow.show();
editorWindow.webContents.openDevTools();
this.mainWindow?.webContents.openDevTools();
if (isStaging) {
editorWindow.webContents.openDevTools();
}
});

editorWindow.webContents.on("before-input-event", (event, input) => {
if (input.key === "F12") {
event.preventDefault();
editorWindow.webContents.toggleDevTools();
this.mainWindow?.webContents.toggleDevTools();
}
});

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

0 comments on commit 3271de0

Please sign in to comment.