feat(p2p): peers backup on exit
This commit is contained in:
@ -91,9 +91,16 @@ class App extends Component {
|
||||
|
||||
window.torrentSocket.on('peer', (numOfPeers) => {
|
||||
window.peers = numOfPeers
|
||||
console.log(window.peers)
|
||||
this.forceUpdate()
|
||||
})
|
||||
|
||||
window.torrentSocket.emit('peers', (numOfPeers) => {
|
||||
if(numOfPeers > 0)
|
||||
{
|
||||
window.peers = numOfPeers
|
||||
this.forceUpdate()
|
||||
}
|
||||
})
|
||||
}
|
||||
componentWillUnmount() {
|
||||
appReady = false;
|
||||
|
Reference in New Issue
Block a user