Fix redirect to new torrent

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

View File

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