Skip to content

Commit

Permalink
Fix initial load for some users
Browse files Browse the repository at this point in the history
  • Loading branch information
Exentrich authored and Exentrich committed Jan 30, 2020
1 parent 2795222 commit 51cea68
Show file tree
Hide file tree
Showing 3 changed files with 563 additions and 399 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Raindrop.io",
"productName": "Raindrop.io",
"version": "5.1.7",
"version": "5.1.8",
"description": "Crossplatform bookmarking app",
"main": "src/index.js",
"repository": {
Expand All @@ -23,18 +23,18 @@
"forge": "./forge.config.js"
},
"dependencies": {
"electron-context-menu": "^0.15.0",
"electron-context-menu": "0.15.x",
"electron-is-dev": "1.x",
"electron-squirrel-startup": "1.x",
"electron-window-state": "5.x",
"update-electron-app": "1.5.x"
},
"devDependencies": {
"@electron-forge/cli": "6.0.0-beta.45",
"@electron-forge/maker-dmg": "^6.0.0-beta.45",
"@electron-forge/maker-squirrel": "^6.0.0-beta.45",
"@electron-forge/maker-zip": "6.0.0-beta.45",
"@electron-forge/publisher-github": "^6.0.0-beta.45",
"@electron-forge/cli": "6.0.0-beta.47",
"@electron-forge/maker-dmg": "^6.0.0-beta.47",
"@electron-forge/maker-squirrel": "^6.0.0-beta.47",
"@electron-forge/maker-zip": "6.0.0-beta.47",
"@electron-forge/publisher-github": "^6.0.0-beta.47",
"electron": "7.1.x"
}
}
24 changes: 15 additions & 9 deletions src/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ module.exports = {
if (this.window) return;

//get defaults
let mainWindowState = windowStateKeeper({
defaultWidth: defaults.width,
defaultHeight: defaults.height
});
let mainWindowState = {}

//could fail for some users, so trycatch
try{
mainWindowState = windowStateKeeper({
defaultWidth: defaults.width,
defaultHeight: defaults.height
})
}catch(e){}

var _this = this;

Expand All @@ -42,19 +47,20 @@ module.exports = {
//sandbox: true
}
});
mainWindowState.manage(this.window);

mainWindowState.manage && mainWindowState.manage(this.window);

contextMenu({
window: this.window
})

/*if (isDev)
if (isDev)
this.window.loadURL('http://dev.raindrop.io')
else*/
else
this.window.loadURL('https://app.raindrop.io/legacy/4')

/*if (isDev)
this.window.webContents.openDevTools();*/
if (isDev)
this.window.webContents.openDevTools();

this.window.webContents.on('will-navigate', this.handleURLChange);
this.window.webContents.on('new-window', function(e,url){
Expand Down
Loading

0 comments on commit 51cea68

Please sign in to comment.