From d568291a9705f5d2b6bea00bcbf683dd0157a27e Mon Sep 17 00:00:00 2001 From: Anton Reshetov Date: Sat, 27 Nov 2021 04:07:09 +0300 Subject: [PATCH] fix(main): set window bounds to store #1 (#2) --- src/main/index.js | 4 +++- src/main/store/module/app.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index e11351d..2422b62 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -30,7 +30,9 @@ function createWindow () { } mainWindow.on('close', e => { - store.app.set('bounds', mainWindow.getBounds()) + if (typeof mainWindow.getBounds() === 'object') { + store.app.set('bounds', mainWindow.getBounds()) + } }) return { mainWindow } diff --git a/src/main/store/module/app.js b/src/main/store/module/app.js index ad561fe..642fae6 100644 --- a/src/main/store/module/app.js +++ b/src/main/store/module/app.js @@ -6,7 +6,7 @@ const app = new Store({ schema: { bounds: { type: 'object', - default: null + default: {} }, addToSubfolder: { type: 'boolean',