Allow uploading torrent files, finally

This commit is contained in:
John Furrow
2016-02-18 22:58:24 -08:00
parent a1c039f91a
commit 0c2a19ceb7
8 changed files with 233 additions and 217 deletions
@@ -65,10 +65,10 @@ export default class AddTorrents extends React.Component {
content: <AddTorrentsByURL />,
label: 'By URL'
},
// 'by-file': {
// content: <AddTorrentsByFile />,
// label: 'By File'
// }
'by-file': {
content: <AddTorrentsByFile />,
label: 'By File'
}
};
return (
@@ -123,6 +123,8 @@ export default class AddTorrents extends React.Component {
fileData.append('torrents', file);
});
fileData.append('destination', this.state.destination);
TorrentActions.addTorrentsByFiles(fileData, this.state.destination);
}
@@ -46,7 +46,13 @@ export default class AddTorrents extends React.Component {
}
onLatestTorrentLocationChange() {
this.setState({destination: UIStore.getLatestTorrentLocation()});
let destination = UIStore.getLatestTorrentLocation();
if (this.props.onChange) {
this.props.onChange(destination);
}
this.setState({destination});
}
render() {