fix(top): remote top shown fix

This commit is contained in:
Alexey Kasyanchuk
2018-03-27 16:58:36 +03:00
parent 9ab5ace232
commit c1cb1976b5

View File

@ -9,6 +9,7 @@ import RaisedButton from 'material-ui/RaisedButton';
import LinearProgress from 'material-ui/LinearProgress';
import {Tabs, Tab} from 'material-ui/Tabs';
import _ from 'lodash'
export default class TopPage extends Page {
constructor(props) {
@ -56,6 +57,7 @@ export default class TopPage extends Page {
this.remoteTopTorrents = ({torrents, type}) => {
if(!torrents)
return
type = type ? type : 'main'
this.topTorrents[type] = _.orderBy(_.unionBy(this.topTorrents[type], torrents, 'hash'), ['seeders'], ['desc'])
this.forceUpdate();
}