Keep apps sorted

This commit is contained in:
Girish Ramakrishnan
2018-01-08 12:38:10 -08:00
parent 5261831ca2
commit 05775a843d
3 changed files with 4 additions and 4 deletions

View File

@@ -324,8 +324,6 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
data.iconUrlStore = icons.store;
data.progress = 0;
that._installedApps.push(data);
callback(null, data.id);
}).error(defaultErrorHandler(callback));
};
@@ -1072,6 +1070,8 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}
}
that._installedApps = that._installedApps.sort(function (app1, app2) { return app1.fqdn.localeCompare(app2.fqdn); });
that._appsListener.forEach(function (callback) {
callback(that._installedApps);
});

View File

@@ -97,7 +97,7 @@ angular.module('Application').controller('DebugController', ['$scope', '$locatio
};
$scope.populateDropdown = function () {
Client.getInstalledApps().sort(function (app1, app2) { return app1.fqdn.localeCompare(app2.fqdn); }).forEach(function (app) {
Client.getInstalledApps().forEach(function (app) {
$scope.apps.push({
type: 'app',
value: app.id,

View File

@@ -23,7 +23,7 @@ angular.module('Application').controller('LogsController', ['$scope', '$location
$scope.logs.push({ name: 'Box', type: 'platform', value: 'box', url: Client.makeURL('/api/v1/cloudron/logs?units=box') });
$scope.logs.push({ name: 'Mail', type: 'platform', value: 'mail', url: Client.makeURL('/api/v1/cloudron/logs?units=mail') });
Client.getInstalledApps().sort(function (app1, app2) { return app1.fqdn.localeCompare(app2.fqdn); }).forEach(function (app) {
Client.getInstalledApps().forEach(function (app) {
$scope.logs.push({
type: 'app',
value: app.id,