Refactor main window creation and configuration

This commit is contained in:
Agampreet Singh
2024-05-08 00:59:05 +05:30
parent af448cac3d
commit 48bab03708

View File

@@ -27,39 +27,22 @@ Object.assign(console, functions);
initialize("A-US-2528580917");
function createWindow() {
if (getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=1") {
var win = new BrowserWindow({
width: 1181,
height: 670,
icon: join(__dirname, "/assets/icons/png/1024x1024.png"),
show: false,
webPreferences: {
nodeIntegration: true,
devTools: true,
partition: "persist:personal",
},
});
} else if (
getValue("enterprise-or-normal") === "https://microsoft365.com/?auth=2"
) {
var win = new BrowserWindow({
width: 1181,
height: 670,
icon: join(__dirname, "/assets/icons/png/1024x1024.png"),
show: false,
webPreferences: {
nodeIntegration: true,
devTools: true,
partition: "persist:work",
},
});
}
if (getValue("autohide-menubar") === "true") {
win.setAutoHideMenuBar(true);
} else {
win.setAutoHideMenuBar(false);
}
const enterpriseOrNormal = getValue("enterprise-or-normal");
const partition = enterpriseOrNormal === "https://microsoft365.com/?auth=1" ? "persist:personal" : "persist:work";
const win = new BrowserWindow({
width: 1181,
height: 670,
icon: join(__dirname, "/assets/icons/png/1024x1024.png"),
show: false,
webPreferences: {
nodeIntegration: true,
devTools: true,
partition: partition,
},
});
win.setAutoHideMenuBar(getValue("autohide-menubar") === "true");
const splash = new BrowserWindow({
width: 810,