Sort attendees and suggestions from most to least popular
This commit is contained in:
parent
43919b3eca
commit
829bde700b
@ -10,7 +10,7 @@ module.exports = function(state = [], action) {
|
||||
for (var i = 0; i < action.attendees.length; i++) {
|
||||
attendees.push(action.attendees[i]);
|
||||
}
|
||||
attendees.sort(function(a, b){return a.Popularity - b.Popularity});
|
||||
attendees.sort(function(a, b){return b.Popularity - a.Popularity});
|
||||
return attendees;
|
||||
case UserConstants.USER_LOGGEDOUT:
|
||||
return [];
|
||||
|
@ -10,7 +10,7 @@ module.exports = function(state = [], action) {
|
||||
for (var i = 0; i < action.suggestions.length; i++) {
|
||||
suggestions.push(action.suggestions[i]);
|
||||
}
|
||||
suggestions.sort(function(a, b){return a.Popularity - b.Popularity});
|
||||
suggestions.sort(function(a, b){return b.Popularity - a.Popularity});
|
||||
return suggestions;
|
||||
case UserConstants.USER_LOGGEDOUT:
|
||||
return [];
|
||||
|
Loading…
Reference in New Issue
Block a user