feat(core): upgrade to electron 16
This commit is contained in:
@ -30,7 +30,8 @@ if(typeof WEB !== 'undefined')
|
||||
}
|
||||
else
|
||||
{
|
||||
const { ipcRenderer, remote } = require('electron');
|
||||
const { ipcRenderer } = require('electron');
|
||||
const remote = require('@electron/remote')
|
||||
window.currentWindow = remote.getCurrentWindow()
|
||||
|
||||
window.torrentSocket = {}
|
||||
|
@ -11,7 +11,7 @@ import SvgIcon from 'material-ui/SvgIcon';
|
||||
import fs from 'fs'
|
||||
let dialog
|
||||
if(typeof WEB === 'undefined')
|
||||
dialog = require('electron').remote.dialog
|
||||
dialog = require('@electron/remote').dialog
|
||||
|
||||
export default class ConfigPage extends Page {
|
||||
constructor(props) {
|
||||
|
@ -3,7 +3,7 @@ import ContextMenu from './context-menu'
|
||||
|
||||
let dialog
|
||||
if(typeof WEB === 'undefined')
|
||||
dialog = require('electron').remote.dialog
|
||||
dialog = require('@electron/remote').dialog
|
||||
|
||||
export default (props) => {
|
||||
return (
|
||||
|
@ -12,7 +12,7 @@ if(typeof WEB === 'undefined')
|
||||
import fs from 'fs'
|
||||
let dialog
|
||||
if(typeof WEB === 'undefined')
|
||||
dialog = require('electron').remote.dialog
|
||||
dialog = require('@electron/remote').dialog
|
||||
class Header extends React.Component {
|
||||
constructor(props)
|
||||
{
|
||||
|
@ -147,6 +147,8 @@ autoUpdater.on('update-downloaded', () => {
|
||||
|
||||
let tray = undefined
|
||||
|
||||
require('@electron/remote/main').initialize();
|
||||
|
||||
app.on("ready", async () => {
|
||||
let rootPath;
|
||||
({ sphinx, rootPath } = await startSphinx(() => {
|
||||
@ -224,6 +226,8 @@ app.on("ready", async () => {
|
||||
tray.setContextMenu(contextMenu)
|
||||
tray.setToolTip('Rats on The Boat search')
|
||||
|
||||
require("@electron/remote/main").enable(mainWindow.webContents);
|
||||
|
||||
mainWindow.webContents.on('will-navigate', (e, url) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
|
@ -25,6 +25,7 @@ export const aboutMenuTemplateFunc = () => ({
|
||||
protocol: "file:",
|
||||
slashes: true
|
||||
}))
|
||||
require("@electron/remote/main").enable(win.webContents);
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
logT('changelog', "finish load page, open changlog")
|
||||
setTimeout(() => win.send('url', '/changelog'), 0)
|
||||
|
Reference in New Issue
Block a user