Skip to content

Commit

Permalink
fix get window size on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcb777 committed Aug 6, 2019
1 parent 1e8c090 commit a21fbb8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/helpers/window-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@ const storageSet = promisify(storage.set)

export const saveWindowSettings = async window => {
if (!window) return

const [width, height] = window.getSize()
const [x, y] = window.getPosition()
const bounds = window.getContentBounds()
const settings = await storageGet('settings')

if (!settings) return

set(settings, 'windowParams', {
width,
height,
x,
y,
})
set(settings, 'windowParams', bounds)

return storageSet('settings', settings)
}
Expand Down

0 comments on commit a21fbb8

Please sign in to comment.