Fix redirect to new torrent

This also fixes some unknown issues with torrent customization.
This commit is contained in:
Drew DeVault 2017-12-29 14:34:53 -05:00
parent 9be338c9dc
commit f4856ba366
2 changed files with 8 additions and 15 deletions

View File

@ -75,10 +75,10 @@ class AddTorrent extends Component {
downloadThrottle
} = this.state;
const { dispatch } = this.props;
const customize = // TODO: File options
const customize =
priority !== 3 ||
uploadThrottle !== -1 ||
downloadThrottle !== -1;
uploadThrottle !== null ||
downloadThrottle !== null;
if (!customize) {
dispatch(push(`/torrents/${id}`));
return;
@ -102,10 +102,10 @@ class AddTorrent extends Component {
this.setState({ loading: true });
const { magnet, file, start } = this.state;
const { dispatch } = this.props;
const customize = // TODO: File options
const customize =
this.state.priority !== 3 ||
this.state.uploadThrottle !== -1 ||
this.state.downloadThrottle !== -1;
this.state.uploadThrottle !== null ||
this.state.downloadThrottle !== null;
const handleOffer = async offer => {
switch (offer.type) {
case "TRANSFER_OFFER":
@ -232,15 +232,6 @@ class AddTorrent extends Component {
<ToggleContainer className="form-group" title="Options">
{this.renderOptions.bind(this)()}
</ToggleContainer>
{torrent &&
<ToggleContainer className="form-group" title="Files">
<Card>
<CardBlock>
TODO
</CardBlock>
</Card>
</ToggleContainer>
}
<button
type="button"
className="btn btn-primary btn-block"

View File

@ -52,12 +52,14 @@ export default class TorrentOptions extends Component {
prop={`dl-throttle-${id}`}
legend="Download throttle"
limit={downloadThrottle}
global={true}
onChange={limit => downloadThrottleChanged(limit)}
/>
<Throttle
prop={`ul-throttle-${id}`}
legend="Upload throttle"
limit={uploadThrottle}
global={true}
onChange={limit => uploadThrottleChanged(limit)}
/>
</div>