Skip to content

Commit 1c4dd29

Browse files
Merge pull request #52651 from nextcloud/backport/52583/stable29
[stable29] fix(apps): Sort names separately from active/update state
2 parents 8096395 + d7ffcc5 commit 1c4dd29

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

apps/settings/src/components/AppList.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,13 @@ export default {
208208
const apps = this.$store.getters.getAllApps
209209
.filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
210210
.sort(function(a, b) {
211-
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name
212-
const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1) + b.name
213-
return OC.Util.naturalSortCompare(sortStringA, sortStringB)
211+
const natSortDiff = OC.Util.naturalSortCompare(a, b)
212+
if (natSortDiff === 0) {
213+
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1)
214+
const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1)
215+
return Number(sortStringA) - Number(sortStringB)
216+
}
217+
return natSortDiff
214218
})
215219
216220
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)