Merge pull request #52653 from nextcloud/backport/52583/stable31

[stable31] fix(apps): Sort names separately from active/update state
This commit is contained in:
Kent Delante 2025-05-06 19:31:44 +08:00 committed by GitHub
commit 1402f6d6b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 9 deletions

View file

@ -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') {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long