2
0
mirror of https://github.com/frappe/books.git synced 2025-01-09 09:50:27 +00:00

fix: set icon only if in dev mode, else not req

This commit is contained in:
18alantom 2021-12-07 13:01:15 +05:30
parent 1d0db3579a
commit ad3b41721d

View File

@ -54,13 +54,12 @@ function getMainWindowSize() {
function createWindow() {
let { width, height } = getMainWindowSize();
mainWindow = new BrowserWindow({
const options = {
vibrancy: 'sidebar',
transparent: isMac,
backgroundColor: '#80FFFFFF',
width,
height,
icon,
title,
webPreferences: {
contextIsolation: false, // TODO: Switch this off
@ -68,7 +67,13 @@ function createWindow() {
},
frame: isLinux,
resizable: true,
});
};
if (isDevelopment) {
Object.assign(options, { icon });
}
mainWindow = new BrowserWindow(options);
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
@ -166,7 +171,9 @@ ipcMain.handle(IPC_ACTIONS.GET_PRIMARY_DISPLAY_SIZE, (event) => {
ipcMain.handle(IPC_ACTIONS.GET_DIALOG_RESPONSE, async (event, options) => {
const window = event.sender.getOwnerBrowserWindow();
if (isDevelopment) {
Object.assign(options, { icon });
}
return await dialog.showMessageBox(window, options);
});
@ -207,7 +214,7 @@ app.on('ready', async () => {
createWindow();
});
if (isMac) {
if (isMac && isDevelopment) {
app.dock.setIcon(icon);
}