Skip to content

Commit

Permalink
Merge pull request #1788 from nextcloud/fix/groups-sort
Browse files Browse the repository at this point in the history
Properly sort groups
  • Loading branch information
skjnldsv authored Sep 6, 2020
2 parents ead1bfa + 13abadd commit 6144342
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"p-queue": "^6.6.1",
"qr-image": "^3.2.0",
"regenerator-runtime": "^0.13.7",
"string-natural-compare": "^3.0.1",
"uuid": "^8.3.0",
"vue": "^2.6.12",
"vue-click-outside": "^1.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/views/Contacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ import { VCardTime } from 'ical.js'
import download from 'downloadjs'
import moment from 'moment'
import pLimit from 'p-limit'
import naturalCompare from 'string-natural-compare'
import ContactDetails from '../components/ContactDetails'
import ContactsList from '../components/ContactsList'
Expand Down Expand Up @@ -447,7 +448,7 @@ export default {
toString: () => group.name,
})
})
menu.sort()
menu.sort((a, b) => naturalCompare(a.toString(), b.toString(), { caseInsensitive: true }))
// Find the Recently Contacted group, delete it from array
const recentlyIndex = menu.findIndex(group => group.name === GROUP_RECENTLY_CONTACTED)
Expand Down

0 comments on commit 6144342

Please sign in to comment.