fix: dev tools

This commit is contained in:
Zamitto 2025-02-15 23:42:14 -03:00
parent 0511cc08c7
commit 3271de09f8

View file

@ -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);
});
}