Show only featured apps first on appstore listing

This commit is contained in:
Johannes Zellner
2018-06-08 09:48:34 +02:00
parent 55fb3b3b55
commit ee0a25962b
2 changed files with 7 additions and 4 deletions

View File

@@ -363,21 +363,19 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.cachedCategory = $scope.category;
$scope.ready = false;
AppStore.getAppsFast(function (error, apps) {
if (error) return $timeout($scope.showCategory.bind(null, event), 1000);
if (!$scope.category) {
$scope.apps = apps;
} else if ($scope.category === 'featured') {
$scope.apps = apps.filter(function (app) { return app.featured; });
} else {
$scope.apps = apps.filter(function (app) {
return app.manifest.tags.some(function (tag) { return $scope.category === tag; });
});
}
$scope.ready = true;
document.getElementById('appstoreGrid').scrollIntoView();
});
};
@@ -533,9 +531,13 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
fetchUsers();
fetchGroups();
// start with featured apps listing
$scope.showCategory(null, 'featured');
// domains is required since we populate the dropdown with domains[0]
Client.getDomains(function (error, result) {
if (error) console.error(error);
$scope.domains = result;
// show install app dialog immediately if an app id was passed in the query