From 159dd90b038fbcd78618c97b51be6c233075b889 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Sun, 8 Oct 2023 05:26:49 +0530 Subject: [PATCH] fix: fixed issue where window width and height were not set for first time users --- packages/bruno-electron/src/store/window-state.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/bruno-electron/src/store/window-state.js b/packages/bruno-electron/src/store/window-state.js index 4b252038..bb0a61b6 100644 --- a/packages/bruno-electron/src/store/window-state.js +++ b/packages/bruno-electron/src/store/window-state.js @@ -1,16 +1,26 @@ const _ = require('lodash'); const Store = require('electron-store'); +const DEFAULT_WINDOW_WIDTH = 1280; +const DEFAULT_WINDOW_HEIGHT = 768; + class WindowStateStore { constructor() { this.store = new Store({ - name: 'window-state', + name: 'preferences', clearInvalidConfig: true }); } getBounds() { - return this.store.get('window-bounds') || {}; + return ( + this.store.get('window-bounds') || { + x: 0, + y: 0, + width: DEFAULT_WINDOW_WIDTH, + height: DEFAULT_WINDOW_HEIGHT + } + ); } setBounds(bounds) {