summaryrefslogtreecommitdiffstats
path: root/settings/src
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-08-10 13:56:14 +0200
committerJulius Härtl <jus@bitgrid.net>2018-08-10 13:56:14 +0200
commite74181b84ba415527f5f2fc60d13f44c5b51288e (patch)
treef627a032d3fe2bd7f37ba70fab298777593358f4 /settings/src
parent1abf0717dff7181fb02fc625fae9e2f29333cea1 (diff)
downloadnextcloud-server-e74181b84ba415527f5f2fc60d13f44c5b51288e.tar.gz
nextcloud-server-e74181b84ba415527f5f2fc60d13f44c5b51288e.zip
Sort apps by a proper hierarchical order (active, update, name)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/src')
-rw-r--r--settings/src/components/appList.vue10
1 files changed, 3 insertions, 7 deletions
diff --git a/settings/src/components/appList.vue b/settings/src/components/appList.vue
index 74c04448f23..2a696bfdcdc 100644
--- a/settings/src/components/appList.vue
+++ b/settings/src/components/appList.vue
@@ -92,13 +92,9 @@ export default {
let apps = this.$store.getters.getAllApps
.filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
.sort(function (a, b) {
- if (a.active !== b.active) {
- return (a.active ? -1 : 1)
- }
- if (a.update !== b.update) {
- return (a.update ? -1 : 1)
- }
- return OC.Util.naturalSortCompare(a.name, b.name);
+ const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name;
+ const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1) + b.name;
+ return OC.Util.naturalSortCompare(sortStringA, sortStringB);
});
if (this.category === 'installed') {