Remove unnecessary IPC
This commit is contained in:
@@ -120,11 +120,11 @@ function sliceArgv (argv) {
|
||||
function processArgv (argv) {
|
||||
argv.forEach(function (arg) {
|
||||
if (arg === '-n') {
|
||||
windows.main.send('dispatch', 'showOpenSeedFiles')
|
||||
menu.showOpenSeedFiles()
|
||||
} else if (arg === '-o') {
|
||||
windows.main.send('dispatch', 'showOpenTorrentFile')
|
||||
menu.showOpenTorrentFile()
|
||||
} else if (arg === '-u') {
|
||||
windows.main.send('showOpenTorrentAddress')
|
||||
menu.showOpenTorrentAddress()
|
||||
} else if (arg.startsWith('-psn')) {
|
||||
// Ignore OS X launchd "process serial number" argument
|
||||
// More: https://github.com/feross/webtorrent-desktop/issues/214
|
||||
|
||||
@@ -43,8 +43,6 @@ function init () {
|
||||
|
||||
ipcMain.on('showOpenTorrentFile', menu.showOpenTorrentFile)
|
||||
|
||||
ipcMain.on('showOpenSeedFiles', menu.showOpenSeedFiles)
|
||||
|
||||
ipcMain.on('setBounds', function (e, bounds, maximize) {
|
||||
setBounds(bounds, maximize)
|
||||
})
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
module.exports = {
|
||||
init,
|
||||
onPlayerClose,
|
||||
onPlayerOpen,
|
||||
onToggleFullScreen,
|
||||
onWindowHide,
|
||||
onWindowShow,
|
||||
onPlayerOpen,
|
||||
onPlayerClose,
|
||||
showOpenSeedFiles,
|
||||
showOpenTorrentAddress,
|
||||
showOpenTorrentFile,
|
||||
toggleFullScreen
|
||||
}
|
||||
@@ -111,8 +112,8 @@ function getMenuItem (label) {
|
||||
// Prompts the user for a file, then makes a torrent out of the data
|
||||
function showOpenSeedFile () {
|
||||
electron.dialog.showOpenDialog({
|
||||
title: 'Select a file for the torrent file',
|
||||
properties: ['openFile']
|
||||
title: 'Select a file for the torrent file.',
|
||||
properties: [ 'openFile' ]
|
||||
}, function (filenames) {
|
||||
if (!Array.isArray(filenames)) return
|
||||
var file = filenames[0]
|
||||
|
||||
@@ -211,9 +211,6 @@ function dispatch (action, ...args) {
|
||||
if (action === 'addTorrent') {
|
||||
addTorrent(args[0] /* torrent */)
|
||||
}
|
||||
if (action === 'showOpenSeedFiles') {
|
||||
ipcRenderer.send('showOpenSeedFiles') /* open file or folder to seed */
|
||||
}
|
||||
if (action === 'showOpenTorrentFile') {
|
||||
ipcRenderer.send('showOpenTorrentFile') /* open torrent file */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user