Move attribute logic to main

This commit is contained in:
smartfrigde 2022-06-14 16:30:18 +02:00
parent 9ab08b16d8
commit c6e2244ce8
2 changed files with 6 additions and 2 deletions

View file

@ -38,10 +38,8 @@ export function injectTitlebar() {
maximize!.addEventListener("click", () => {
if (ipcRenderer.sendSync("win-isMaximized") == true) {
ipcRenderer.send("win-unmaximize");
document.body.removeAttribute("isMaximized");
} else {
ipcRenderer.send("win-maximize");
document.body.setAttribute("isMaximized", "");
}
});

View file

@ -81,6 +81,12 @@ async function doAfterDefiningTheWindow() {
app.quit();
}
});
mainWindow.on('maximize',() =>{
mainWindow.webContents.executeJavaScript(`document.body.setAttribute("isMaximized", "");`)
})
mainWindow.on('unmaximize',() =>{
mainWindow.webContents.executeJavaScript(`document.body.removeAttribute("isMaximized");`)
})
console.log(contentPath);
if ((await getConfig("inviteWebsocket")) == true) {
startServer();