Skip to content

Commit

Permalink
feat: Upgrade to electron v6 and electron-builder v21
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Sep 19, 2019
1 parent c3e3da0 commit c3796db
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
32 changes: 15 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ var installStatsIndex = require('./src/main/osm-stats')
var TileImporter = require('./src/main/tile-importer')
var locale = require('./src/main/locale')

if (require('electron-squirrel-startup')) {
process.exit(0)
}

// HACK: enable GPU graphics acceleration on some older laptops
app.commandLine.appendSwitch('ignore-gpu-blacklist', 'true')

Expand All @@ -42,20 +38,19 @@ var log = null
var win = null
var splash = null

var shouldQuit = app.makeSingleInstance(function (
commandLine,
workingDirectory
) {
// Someone tried to run a second instance, we should focus our window.
if (win) {
if (win.isMinimized()) win.restore()
win.focus()
}
})
var gotTheLock = app.requestSingleInstanceLock()

if (shouldQuit) {
app.quit()
if (!gotTheLock) {
// Didn't get a lock, because another instance is open, so we quit
process.exit(0)
} else {
app.on('second-instance', () => {
// Someone tried to run a second instance, we should focus our window.
if (win) {
if (win.isMinimized()) win.restore()
win.focus()
}
})
}

// Path to `userData`, operating system specific, see
Expand Down Expand Up @@ -101,7 +96,10 @@ function openWindow () {
show: false,
alwaysOnTop: false,
titleBarStyle: 'hidden',
icon: path.resolve(__dirname, 'static', 'mapeo_256x256.png')
icon: path.resolve(__dirname, 'static', 'mapeo_256x256.png'),
webPreferences: {
nodeIntegration: true
}
})
splash = new BrowserWindow({
width: 810,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"inherits": "^2.0.3",
"insert-css": "^1.0.0",
"lodash": "^4.17.4",
"mapeo-server": "^16.0.0",
"mapeo-server": "^16.1.1",
"mapeo-styles": "^3.0.0",
"minimist": "^1.2.0",
"mirror-folder": "^2.1.1",
Expand Down Expand Up @@ -137,8 +137,8 @@
"cross-spawn": "^4.0.2",
"css-loader": "^3.2.0",
"devtron": "^1.2.0",
"electron": "^2.0.7",
"electron-builder": "^20.8.1",
"electron": "^6.0.10",
"electron-builder": "^21.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-rebuild": "^1.8.6",
"eslint": "^6.4.0",
Expand All @@ -149,7 +149,7 @@
"hubfs.js": "^1.0.0",
"license-check": "^1.1.5",
"mock-data": "^1.5.5",
"npm-platform-dependencies": "0.0.12",
"npm-platform-dependencies": "^0.1.0",
"patch-package": "^6.2.0",
"pngjs": "^3.3.3",
"spectron": "^4.0.0",
Expand All @@ -160,7 +160,7 @@
"tape": "^4.9.1",
"watchify": "^3.7.0",
"webpack": "^4.40.2",
"webpack-cli": "^3.3.8",
"webpack-cli": "^3.3.9",
"webpack-livereload-plugin": "^2.2.0",
"webpack-node-externals": "^1.7.2"
},
Expand Down

0 comments on commit c3796db

Please sign in to comment.