diff options
author | Kent Delante <kent.delante@proton.me> | 2025-04-30 18:16:04 +0800 |
---|---|---|
committer | Kent Delante <kent.delante@proton.me> | 2025-05-02 14:10:38 +0800 |
commit | 9fbb3d8b4de8848b1a85f8fb8523be1eab34f03a (patch) | |
tree | e4bebb123ef45ced14f76353750373389ee43c0d /apps/settings/src/components/AppList.vue | |
parent | 57e0ffcb27f8318f2a4f59115cdf9db31fb73eeb (diff) | |
download | nextcloud-server-9fbb3d8b4de8848b1a85f8fb8523be1eab34f03a.tar.gz nextcloud-server-9fbb3d8b4de8848b1a85f8fb8523be1eab34f03a.zip |
fix(apps): Sort names separately from active/update stateleftybournes/fix/app-sorting
Signed-off-by: Kent Delante <kent.delante@proton.me>
Diffstat (limited to 'apps/settings/src/components/AppList.vue')
-rw-r--r-- | apps/settings/src/components/AppList.vue | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/settings/src/components/AppList.vue b/apps/settings/src/components/AppList.vue index cfc778fe409..3e40e08b257 100644 --- a/apps/settings/src/components/AppList.vue +++ b/apps/settings/src/components/AppList.vue @@ -200,9 +200,13 @@ export default { const apps = [...this.$store.getters.getAllApps, ...exApps] .filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1) .sort(function(a, b) { - 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) + const natSortDiff = OC.Util.naturalSortCompare(a, b) + if (natSortDiff === 0) { + const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1) + return Number(sortStringA) - Number(sortStringB) + } + return natSortDiff }) if (this.category === 'installed') { |