fix(top): remote top shown fix
This commit is contained in:
@ -9,6 +9,7 @@ import RaisedButton from 'material-ui/RaisedButton';
|
|||||||
import LinearProgress from 'material-ui/LinearProgress';
|
import LinearProgress from 'material-ui/LinearProgress';
|
||||||
|
|
||||||
import {Tabs, Tab} from 'material-ui/Tabs';
|
import {Tabs, Tab} from 'material-ui/Tabs';
|
||||||
|
import _ from 'lodash'
|
||||||
|
|
||||||
export default class TopPage extends Page {
|
export default class TopPage extends Page {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -56,6 +57,7 @@ export default class TopPage extends Page {
|
|||||||
this.remoteTopTorrents = ({torrents, type}) => {
|
this.remoteTopTorrents = ({torrents, type}) => {
|
||||||
if(!torrents)
|
if(!torrents)
|
||||||
return
|
return
|
||||||
|
type = type ? type : 'main'
|
||||||
this.topTorrents[type] = _.orderBy(_.unionBy(this.topTorrents[type], torrents, 'hash'), ['seeders'], ['desc'])
|
this.topTorrents[type] = _.orderBy(_.unionBy(this.topTorrents[type], torrents, 'hash'), ['seeders'], ['desc'])
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user