feat(deps): switch to new electron

This commit is contained in:
Alexey Kasyanchuk 2021-01-04 03:05:23 +03:00
parent ab5303ecae
commit e3c20a6fe2
4 changed files with 6100 additions and 4402 deletions

10471
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -112,9 +112,9 @@
"compare-versions": "^3.5.0", "compare-versions": "^3.5.0",
"debug": "^4.1.1", "debug": "^4.1.1",
"detect-onebyte-encoding": "^1.0.3", "detect-onebyte-encoding": "^1.0.3",
"electron-context-menu": "^0.15.0", "electron-context-menu": "^2.3.1",
"electron-log": "^3.0.8", "electron-log": "^4.3.1",
"electron-updater": "^4.1.2", "electron-updater": "^4.3.5",
"fs-jetpack": "^2.2.2", "fs-jetpack": "^2.2.2",
"glob": "^7.1.4", "glob": "^7.1.4",
"google": "^2.1.0", "google": "^2.1.0",
@ -154,18 +154,18 @@
"chai": "^4.2.0", "chai": "^4.2.0",
"copy-webpack-plugin": "^5.0.3", "copy-webpack-plugin": "^5.0.3",
"css-loader": "^3.1.0", "css-loader": "^3.1.0",
"electron": "6.0.12", "electron": "11.1.1",
"electron-builder": "21.2.0", "electron-builder": "22.9.1",
"eslint": "^6.0.1", "eslint": "^6.0.1",
"eslint-plugin-react": "^7.14.2", "eslint-plugin-react": "^7.14.2",
"express": "^4.17.1", "express": "^4.17.1",
"friendly-errors-webpack-plugin": "^1.7.0", "friendly-errors-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"md5-file": "^4.0.0", "md5-file": "^4.0.0",
"mocha": "^6.2.2", "mocha": "^8.2.1",
"socket.io": "^2.2.0", "socket.io": "^2.2.0",
"source-map-support": "^0.5.12", "source-map-support": "^0.5.12",
"spectron": "8.0.0", "spectron": "13.0.0",
"style-loader": "^0.23.1", "style-loader": "^0.23.1",
"sw-precache-webpack-plugin": "^0.11.5", "sw-precache-webpack-plugin": "^0.11.5",
"url-loader": "^2.1.0", "url-loader": "^2.1.0",

View File

@ -60,8 +60,12 @@ else
} }
ipcRenderer.on('callback', (event, id, data) => { ipcRenderer.on('callback', (event, id, data) => {
const callback = window.torrentSocket.callbacks[id] const callback = window.torrentSocket.callbacks[id]
if(callback) if(callback) {
callback(data) if(data)
callback(JSON.parse(data))
else
callback(data)
}
delete window.torrentSocket.callbacks[id] delete window.torrentSocket.callbacks[id]
}); });

View File

@ -182,7 +182,8 @@ app.on("ready", async () => {
width: 1000, width: 1000,
height: 600, height: 600,
webPreferences: { webPreferences: {
nodeIntegration: true nodeIntegration: true,
enableRemoteModule: true,
} }
}); });
@ -211,10 +212,10 @@ app.on("ready", async () => {
mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show() mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show()
}) })
mainWindow.on('show', () => { mainWindow.on('show', () => {
tray.setHighlightMode('always') //tray.setHighlightMode('always')
}) })
mainWindow.on('hide', () => { mainWindow.on('hide', () => {
tray.setHighlightMode('never') //tray.setHighlightMode('never')
}) })
mainWindow.on('close', (event) => { mainWindow.on('close', (event) => {
@ -314,7 +315,7 @@ app.on("ready", async () => {
const id = arg[arg.length - 1].callback const id = arg[arg.length - 1].callback
arg[arg.length - 1] = (responce) => { arg[arg.length - 1] = (responce) => {
if(mainWindow) if(mainWindow)
mainWindow.webContents.send('callback', id, responce) mainWindow.webContents.send('callback', id, JSON.stringify(responce))
} }
} }
callback.apply(null, arg) callback.apply(null, arg)