diff --git a/app/package.json b/app/package.json index bb16caa..96aa2a8 100644 --- a/app/package.json +++ b/app/package.json @@ -4,6 +4,7 @@ "description": "Placeholder for the nativefier cli to override with a target url", "main": "lib/main.js", "dependencies": { + "electron-window-state": "^2.0.0", "wurl": "^2.1.0" }, "devDependencies": {}, diff --git a/app/src/main.js b/app/src/main.js index 1fefbcb..b93a557 100644 --- a/app/src/main.js +++ b/app/src/main.js @@ -8,7 +8,7 @@ var electron = require('electron'); var createMainWindow = require('./components/mainWindow/mainWindow'); var createLoginWindow = require('./components/login/loginWindow'); var helpers = require('./helpers/helpers'); - +var windowStateKeeper = require('electron-window-state'); var app = electron.app; var ipcMain = electron.ipcMain; var isOSX = helpers.isOSX; @@ -47,7 +47,12 @@ app.on('before-quit', function () { }); app.on('ready', function () { + var mainWindowState = windowStateKeeper({ + defaultWidth: appArgs.width || 1280, + defaultHeight: appArgs.height || 800 + }); mainWindow = createMainWindow(appArgs, app.quit, app.dock.setBadge); + mainWindowState.manage(mainWindow); }); app.on('login', function(event, webContents, request, authInfo, callback) {