handler error when loading electron store

This commit is contained in:
Jan Prochazka 2021-12-26 14:25:03 +01:00
parent 94553504a7
commit 11f6b82b72

View File

@ -168,7 +168,12 @@ ipcMain.handle('openExternal', async (event, url) => {
});
function createWindow() {
const bounds = store.get('winBounds');
let bounds = null;
try {
bounds = store.get('winBounds');
} catch (err) {
console.log('Error loading bounds from electron store', err.message);
}
mainWindow = new BrowserWindow({
width: 1200,
@ -182,9 +187,13 @@ function createWindow() {
},
});
try {
if (store.get('winIsMaximized')) {
mainWindow.maximize();
}
} catch (err) {
console.log('Error loading maximized flag from electron store', err.message);
}
mainMenu = buildMenu();
mainWindow.setMenu(mainMenu);