mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix(apps): Sort names separately from active/update state
Signed-off-by: Kent Delante <kent.delante@proton.me>
This commit is contained in:
parent
d12e37f51f
commit
7b18ecafbe
1 changed files with 7 additions and 3 deletions
|
|
@ -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') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue