mirror of
https://github.com/usebruno/bruno.git
synced 2025-02-16 17:51:48 +01:00
fix: fixed issue where window width and height were not set for first time users
This commit is contained in:
parent
c222bf47c3
commit
159dd90b03
@ -1,16 +1,26 @@
|
|||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const Store = require('electron-store');
|
const Store = require('electron-store');
|
||||||
|
|
||||||
|
const DEFAULT_WINDOW_WIDTH = 1280;
|
||||||
|
const DEFAULT_WINDOW_HEIGHT = 768;
|
||||||
|
|
||||||
class WindowStateStore {
|
class WindowStateStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.store = new Store({
|
this.store = new Store({
|
||||||
name: 'window-state',
|
name: 'preferences',
|
||||||
clearInvalidConfig: true
|
clearInvalidConfig: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getBounds() {
|
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) {
|
setBounds(bounds) {
|
||||||
|
Loading…
Reference in New Issue
Block a user