Add timeout message when searching for peers
parent
57fba6c8ed
commit
c5ba778b95
|
|
@ -43,7 +43,8 @@ class FileEntry extends Component
|
||||||
files : torrent.files,
|
files : torrent.files,
|
||||||
numPeers : torrent.numPeers,
|
numPeers : torrent.numPeers,
|
||||||
progress : 1,
|
progress : 1,
|
||||||
active : false
|
active : false,
|
||||||
|
timeout : false
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -90,6 +91,16 @@ class FileEntry extends Component
|
||||||
}
|
}
|
||||||
|
|
||||||
client.add(magnetURI, this.handleTorrent);
|
client.add(magnetURI, this.handleTorrent);
|
||||||
|
|
||||||
|
setTimeout(() =>
|
||||||
|
{
|
||||||
|
if (this.state.active && this.state.numPeers === 0)
|
||||||
|
{
|
||||||
|
this.setState({
|
||||||
|
timeout : true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 10 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
render()
|
render()
|
||||||
|
|
@ -122,9 +133,18 @@ class FileEntry extends Component
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{this.state.active && this.state.numPeers === 0 && (
|
{this.state.active && this.state.numPeers === 0 && (
|
||||||
<p>
|
<Fragment>
|
||||||
Locating peers
|
<p>
|
||||||
</p>
|
Locating peers
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{this.state.timeout && (
|
||||||
|
<p>
|
||||||
|
If this process takes a long time, there might not be anyone seeding
|
||||||
|
this torrent. Try asking someone to reupload the file that you want.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{this.state.active && this.state.numPeers > 0 && (
|
{this.state.active && this.state.numPeers > 0 && (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue