Fix obsolete 'shell' API
This commit is contained in:
@@ -15,7 +15,7 @@ const ListGroupItem = ReactBootstrap.ListGroupItem;
|
|||||||
|
|
||||||
const LoginModal = require('./components/loginModal.jsx');
|
const LoginModal = require('./components/loginModal.jsx');
|
||||||
|
|
||||||
const {remote, ipcRenderer, webFrame} = require('electron');
|
const {remote, ipcRenderer, webFrame, shell} = require('electron');
|
||||||
|
|
||||||
const osLocale = require('os-locale');
|
const osLocale = require('os-locale');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
@@ -334,7 +334,7 @@ var MattermostView = React.createClass({
|
|||||||
window.open(e.url, 'Mattermost', 'nodeIntegration=no');
|
window.open(e.url, 'Mattermost', 'nodeIntegration=no');
|
||||||
} else {
|
} else {
|
||||||
// if the link is external, use default browser.
|
// if the link is external, use default browser.
|
||||||
require('shell').openExternal(e.url);
|
shell.openExternal(e.url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -3,7 +3,8 @@
|
|||||||
const {
|
const {
|
||||||
app,
|
app,
|
||||||
dialog,
|
dialog,
|
||||||
ipcMain
|
ipcMain,
|
||||||
|
shell
|
||||||
} = require('electron');
|
} = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
@@ -23,7 +24,7 @@ function init(mainWindow) {
|
|||||||
function initDialogEvent(mainWindow) {
|
function initDialogEvent(mainWindow) {
|
||||||
ipcMain.on('confirm-protocol', (event, protocol, URL) => {
|
ipcMain.on('confirm-protocol', (event, protocol, URL) => {
|
||||||
if (allowedProtocols.indexOf(protocol) !== -1) {
|
if (allowedProtocols.indexOf(protocol) !== -1) {
|
||||||
require('shell').openExternal(URL);
|
shell.openExternal(URL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dialog.showMessageBox(mainWindow, {
|
dialog.showMessageBox(mainWindow, {
|
||||||
@@ -47,7 +48,7 @@ function initDialogEvent(mainWindow) {
|
|||||||
});
|
});
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case 0:
|
case 0:
|
||||||
require('shell').openExternal(URL);
|
shell.openExternal(URL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user