Fix redirect to new torrent
This also fixes some unknown issues with torrent customization.
This commit is contained in:
parent
9be338c9dc
commit
f4856ba366
|
@ -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"
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user