Skip to content

Commit 4cd65b0

Browse files
authored
Merge pull request #59848 from nextcloud/jtr/fix-settings-sort-list
fix(settings): sort app list by app name instead of app objects
2 parents c8142d5 + ccdd49e commit 4cd65b0

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

apps/settings/src/components/AppList.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,12 @@ export default {
226226
const apps = [...this.$store.getters.getAllApps, ...exApps]
227227
.filter((app) => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
228228
.sort(function(a, b) {
229-
const natSortDiff = OC.Util.naturalSortCompare(a, b)
230-
if (natSortDiff === 0) {
231-
const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1)
232-
const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1)
233-
return Number(sortStringA) - Number(sortStringB)
229+
const statusA = (a.active ? 0 : 2) + (a.update ? 0 : 1)
230+
const statusB = (b.active ? 0 : 2) + (b.update ? 0 : 1)
231+
if (statusA !== statusB) {
232+
return statusA - statusB
234233
}
235-
return natSortDiff
234+
return OC.Util.naturalSortCompare(a.name, b.name)
236235
})
237236
238237
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)