Skip to content

Commit 8f6fe59

Browse files
author
Kent Delante
authored
Merge pull request #52652 from nextcloud/backport/52583/stable30
[stable30] fix(apps): Sort names separately from active/update state
2 parents 4195491 + 640badf commit 8f6fe59

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

apps/settings/src/components/AppList.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,13 @@ export default {
200200
const apps = [...this.$store.getters.getAllApps, ...exApps]
201201
.filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
202202
.sort(function(a, b) {
203-
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name
204-
const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1) + b.name
205-
return OC.Util.naturalSortCompare(sortStringA, sortStringB)
203+
const natSortDiff = OC.Util.naturalSortCompare(a, b)
204+
if (natSortDiff === 0) {
205+
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1)
206+
const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1)
207+
return Number(sortStringA) - Number(sortStringB)
208+
}
209+
return natSortDiff
206210
})
207211
208212
if (this.category === 'installed') {

dist/settings-apps-view-4529.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-apps-view-4529.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)