Make it a toggle

This commit is contained in:
Amelia Frost 2026-04-04 12:35:06 -07:00
parent 363f9f675b
commit 0c2d23d029
No known key found for this signature in database

View file

@ -68,6 +68,7 @@ export function createMainWindow() {
contextIsolation: true, contextIsolation: true,
nodeIntegration: false, nodeIntegration: false,
spellcheck: true, spellcheck: true,
devTools: true,
}, },
}); });
@ -150,8 +151,12 @@ export function createMainWindow() {
) { ) {
event.preventDefault(); event.preventDefault();
mainWindow.webContents.reload(); mainWindow.webContents.reload();
} else if(input.key=='F12'){ } else if (input.key === "F12") {
mainWindow.webContents.openDevTools({ mode: "detach" }); if (mainWindow.webContents.isDevToolsOpened()) {
mainWindow.webContents.closeDevTools();
} else {
mainWindow.webContents.openDevTools({ mode: "detach" });
}
} }
}); });