fix(download): fix download to directory after update

This commit is contained in:
Alexey Kasyanchuk 2019-10-27 22:03:28 +03:00
parent d323485f93
commit f121c118a3

View File

@ -40,14 +40,15 @@ export default (props) => {
</g> </g>
</svg> </svg>
}, },
{name: __('Download to') + '...', click: () => { {name: __('Download to') + '...', click: async () => {
if(dialog) if(dialog)
{ {
const path = dialog.showOpenDialog({ const path = (await dialog.showOpenDialog({
properties: ['openDirectory'] properties: ['openDirectory']
}); })).filePaths;
if(!path || path.length < 1) if(!path || path.length < 1)
return return
console.log(path);
window.torrentSocket.emit('download', props.torrent, path[0], (added) => { window.torrentSocket.emit('download', props.torrent, path[0], (added) => {
if(props.onAdded) if(props.onAdded)
props.onAdded(added) props.onAdded(added)