appstore: fix ordering of apps
all apps: alphabetical popular: based on ranking instead of installCount New Apps: based on time only Category: tag and then ranking
This commit is contained in:
@@ -455,17 +455,17 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
if (error) return $timeout($scope.showCategory.bind(null, category), 1000);
|
||||
|
||||
if (!$scope.category) {
|
||||
$scope.apps = apps;
|
||||
$scope.apps = apps.slice(0).sort(function (a1, a2) { return a1.manifest.title.localeCompare(a2.manifest.title); });
|
||||
} else if ($scope.category === 'featured') {
|
||||
$scope.apps = apps.filter(function (app) { return app.featured; });
|
||||
$scope.apps = apps.filter(function (app) { return app.featured; }).sort(function (a1, a2) { return a2.ranking - a1.ranking; }); // reverse sort
|
||||
} else if ($scope.category === 'new') {
|
||||
$scope.apps = filterForNewApps(apps);
|
||||
} else if ($scope.category === 'recent') {
|
||||
$scope.apps = filterForRecentlyUpdatedApps(apps);
|
||||
} else {
|
||||
$scope.apps = apps.filter(function (app) {
|
||||
return app.manifest.tags.some(function (tag) { return $scope.category === tag; });
|
||||
});
|
||||
return app.manifest.tags.some(function (tag) { return $scope.category === tag; }); // reverse sort;
|
||||
}).sort(function (a1, a2) { return a2.ranking - a1.ranking; });
|
||||
}
|
||||
|
||||
// ensure we scroll to top
|
||||
|
||||
Reference in New Issue
Block a user