Skip to content

Commit

Permalink
fix bug on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmerAL committed May 31, 2016
1 parent 5ec0e40 commit 268018e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function sendIPCToWindow (window, action, data) {

function createWindow (cb) {
var savedBounds = fs.readFile(appDataPath + 'windowBounds.json', 'utf-8', function (e, data) {
if (e) { // there was an error, probably because the file doesn't exist
if (e || !data) { // there was an error, probably because the file doesn't exist
var size = electron.screen.getPrimaryDisplay().workAreaSize
var bounds = {
x: 0,
Expand Down Expand Up @@ -177,7 +177,7 @@ app.on('open-url', function (e, url) {
*
* Opens a new tab when all tabs are closed, and min is still open by clicking on the application dock icon
*/
app.on('activate', function (/* e, hasVisibleWindows */) {
app.on('activate', function ( /* e, hasVisibleWindows */) {
if (!mainWindow && appIsReady) { // sometimes, the event will be triggered before the app is ready, and creating new windows will fail
createWindow()
}
Expand Down

0 comments on commit 268018e

Please sign in to comment.