From cb37f7525c804fed6819eaf307378f3e5327db04 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Wed, 5 Feb 2020 23:46:17 +0900
Subject: [PATCH] Upgrade Electron version to 7.1.11
---
package-lock.json | 61 +++++++----------------------------------------
package.json | 4 ++--
src/main/index.ts | 31 ++++++++++++++----------
3 files changed, 29 insertions(+), 67 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 7bea049a..e84d83fb 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6317,7 +6317,7 @@
"dependencies": {
"resolve": {
"version": "1.1.7",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
+ "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
"integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=",
"dev": true
}
@@ -9127,20 +9127,20 @@
"dev": true
},
"electron": {
- "version": "6.1.7",
- "resolved": "https://registry.npmjs.org/electron/-/electron-6.1.7.tgz",
- "integrity": "sha512-QhBA/fcYJit2XJGkD2xEfxlWTtTaWYu7qkKVohtVWXpELFqkpel2DCDxet5BTo0qs8ukuZHxlQPnIonODnl2bw==",
+ "version": "7.1.11",
+ "resolved": "https://registry.npmjs.org/electron/-/electron-7.1.11.tgz",
+ "integrity": "sha512-YDXfnovKY+8iZ5ISQh1kRqYIRKbpOSxGXCx2WVxPFPutEQ7Q/Xzr3h4GePEY25/NXMytMfhKaAZAYjtWUm3r9Q==",
"dev": true,
"requires": {
- "@types/node": "^10.12.18",
- "electron-download": "^4.1.0",
+ "@electron/get": "^1.0.1",
+ "@types/node": "^12.0.12",
"extract-zip": "^1.0.3"
},
"dependencies": {
"@types/node": {
- "version": "10.17.13",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz",
- "integrity": "sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg==",
+ "version": "12.12.26",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.26.tgz",
+ "integrity": "sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA==",
"dev": true
}
}
@@ -9850,23 +9850,6 @@
"unused-filename": "^1.0.0"
}
},
- "electron-download": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-4.1.1.tgz",
- "integrity": "sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg==",
- "dev": true,
- "requires": {
- "debug": "^3.0.0",
- "env-paths": "^1.0.0",
- "fs-extra": "^4.0.1",
- "minimist": "^1.2.0",
- "nugget": "^2.0.1",
- "path-exists": "^3.0.0",
- "rc": "^1.2.1",
- "semver": "^5.4.1",
- "sumchecker": "^2.0.2"
- }
- },
"electron-is-accelerator": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/electron-is-accelerator/-/electron-is-accelerator-0.1.2.tgz",
@@ -10272,12 +10255,6 @@
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA="
},
- "env-paths": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz",
- "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=",
- "dev": true
- },
"errno": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
@@ -23081,26 +23058,6 @@
"postcss": "^7.0.2"
}
},
- "sumchecker": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-2.0.2.tgz",
- "integrity": "sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4=",
- "dev": true,
- "requires": {
- "debug": "^2.2.0"
- },
- "dependencies": {
- "debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
- "requires": {
- "ms": "2.0.0"
- }
- }
- }
- },
"supports-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
diff --git a/package.json b/package.json
index acecd9b7..d330abc7 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
"build:linux": "npm run build && npm run package:linux",
"build:win32": "npm run build && npm run package:win32",
"build:win64": "npm run build && npm run package:win64",
- "build:mas": "npm run build:clean && npm run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --electron-version=6.1.7 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --osx-sign --app-category-type=public.app-category.social-networking",
+ "build:mas": "npm run build:clean && npm run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --electron-version=7.1.11 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --osx-sign --app-category-type=public.app-category.social-networking",
"package:mac": "electron-builder --mac --x64",
"package:linux": "electron-builder --linux",
"package:win32": "electron-builder --win --ia32",
@@ -242,7 +242,7 @@
"css-loader": "^3.2.0",
"del": "^5.1.0",
"devtron": "^1.4.0",
- "electron": "6.1.7",
+ "electron": "7.1.11",
"electron-builder": "^22.0.0",
"electron-debug": "^3.0.1",
"electron-devtools-installer": "^2.2.4",
diff --git a/src/main/index.ts b/src/main/index.ts
index fd22f053..21807c26 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -281,10 +281,9 @@ async function createWindow() {
* Get system proxy configuration.
*/
if (session && session.defaultSession) {
- session.defaultSession.resolveProxy('https://mastodon.social', proxyInfo => {
- proxyConfiguration.setSystemProxy(proxyInfo)
- log.info(`System proxy configuration: ${proxyInfo}`)
- })
+ const proxyInfo = await session.defaultSession.resolveProxy('https://mastodon.social')
+ proxyConfiguration.setSystemProxy(proxyInfo)
+ log.info(`System proxy configuration: ${proxyInfo}`)
}
mainWindow.on('closed', () => {
@@ -332,15 +331,21 @@ app.on('window-all-closed', () => {
} else {
// In MacOS, we should change disable some menu items.
const menu = Menu.getApplicationMenu()
- if (menu !== null) {
- // Preferences
- menu.items[0].submenu.items[2].enabled = false as boolean
- // New Toot
- menu.items[1].submenu.items[0].enabled = false as boolean
- // Open Window
- menu.items[4].submenu.items[1].enabled = true as boolean
- // Jump to
- menu.items[4].submenu.items[4].enabled = false as boolean
+ if (menu) {
+ if (menu.items[0].submenu) {
+ // Preferences
+ menu.items[0].submenu.items[2].enabled = false
+ }
+ if (menu.items[1].submenu) {
+ // New Toot
+ menu.items[1].submenu.items[0].enabled = false
+ }
+ if (menu.items[4].submenu) {
+ // Open Window
+ menu.items[4].submenu.items[1].enabled = true
+ // Jump to
+ menu.items[4].submenu.items[4].enabled = false
+ }
}
}
})