mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-10-18 14:13:21 +00:00
hashtag list ordering
This commit is contained in:
parent
bb53bc2319
commit
d71df23e6d
@ -36,10 +36,10 @@ export default class HashtagList extends Component {
|
||||
.sort((tag1,tag2) => {
|
||||
const set1 = this.hashtagSubscribers[tag1];
|
||||
const set2 = this.hashtagSubscribers[tag2];
|
||||
if (set1.length !== set2.length) {
|
||||
return set1.length < set2.length;
|
||||
if (set1.size !== set2.size) {
|
||||
return set1.size > set2.size ? -1 : 1;
|
||||
} else {
|
||||
return tag1 > tag2;
|
||||
return tag1 > tag2 ? 1 : -1;
|
||||
}
|
||||
}).slice(0,8);
|
||||
this.setState({popularHashtags});
|
||||
|
Loading…
Reference in New Issue
Block a user