mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
handler error when loading electron store
This commit is contained in:
parent
94553504a7
commit
11f6b82b72
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user