Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closes #119 Save window state #124

Merged
merged 1 commit into from
Mar 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"dependencies": {
"axios": "^0.18.0",
"electron-log": "^2.2.14",
"electron-window-state": "^4.1.1",
"element-ui": "^2.2.1",
"google-fonts-webpack-plugin": "^0.4.4",
"is-empty": "^1.2.0",
Expand Down
12 changes: 10 additions & 2 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { app, ipcMain, BrowserWindow, shell, Menu } from 'electron'
import Datastore from 'nedb'
import empty from 'is-empty'
import log from 'electron-log'
import windowStateKeeper from 'electron-window-state'

import Authentication from './auth'
import Account from './account'
Expand Down Expand Up @@ -170,13 +171,20 @@ function createWindow () {
/**
* Initial window options
*/
let mainWindowState = windowStateKeeper({
defaultWidth: 1000,
height: 563
})
mainWindow = new BrowserWindow({
titleBarStyle: 'hidden',
height: 563,
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
useContentSize: true,
width: 1000,
icon: require('path').join(__dirname, '../../build/icons/256x256.png')
})
mainWindowState.manage(mainWindow)

mainWindow.loadURL(winURL)

Expand Down