menu: open torrent file dialog comes from main window

This commit is contained in:
Feross Aboukhadijeh
2016-03-02 02:33:36 -08:00
parent 7a22e73840
commit 6297269271

View File

@@ -101,11 +101,11 @@ var template = [
label: 'Open Torrent File...',
accelerator: 'CmdOrCtrl+O',
click: function () {
electron.dialog.showOpenDialog({
electron.dialog.showOpenDialog(mainWindow, {
title: 'Select a .torrent file to open.',
properties: [ 'openFile', 'multiSelections' ]
}, function (filenames) {
if (!Array.isArary(filenames)) return
if (!Array.isArray(filenames)) return
filenames.forEach(function (filename) {
mainWindow.send('action', 'addTorrent', filename)
})