исправление возможной ошибки запроса
This commit is contained in:
@ -149,8 +149,10 @@ export default class RecentTorrents extends Component {
|
||||
}
|
||||
componentDidMount() {
|
||||
window.torrentSocket.emit('recentTorrents', (data) => {
|
||||
this.torrents = data;
|
||||
this.forceUpdate();
|
||||
if(data) {
|
||||
this.torrents = data;
|
||||
this.forceUpdate();
|
||||
}
|
||||
});
|
||||
this.newTorrentFunc = (torrent) => {
|
||||
this.torrents.unshift(torrent);
|
||||
|
@ -47,8 +47,10 @@ export default class Search extends Component {
|
||||
}
|
||||
componentDidMount() {
|
||||
this.newStatisticFunc = (statistic) => {
|
||||
this.stats = statistic;
|
||||
this.forceUpdate();
|
||||
if(statistic) {
|
||||
this.stats = statistic;
|
||||
this.forceUpdate();
|
||||
}
|
||||
};
|
||||
window.torrentSocket.emit('statistic', this.newStatisticFunc);
|
||||
window.torrentSocket.on('newStatistic', this.newStatisticFunc);
|
||||
|
@ -138,8 +138,10 @@ export default class TorrentPage extends Component {
|
||||
};
|
||||
componentDidMount() {
|
||||
window.torrentSocket.emit('torrent', this.props.hash, {files: true}, (data) => {
|
||||
this.torrent = data
|
||||
this.forceUpdate();
|
||||
if(data) {
|
||||
this.torrent = data
|
||||
this.forceUpdate();
|
||||
}
|
||||
});
|
||||
}
|
||||
render() {
|
||||
|
Reference in New Issue
Block a user