Merge pull request #37878 from 2lar/sortingfixbranch

This commit is contained in:
John Molakvoæ 2024-08-07 12:45:56 +02:00 committed by GitHub
commit 3da69fca60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 15 additions and 10 deletions

View file

@ -260,11 +260,16 @@ export default {
*/
processShares({ data }) {
if (data.ocs && data.ocs.data && data.ocs.data.length > 0) {
// create Share objects and sort by newest
// create Share objects and sort by title in alphabetical order and then by creation time
const shares = data.ocs.data
.map(share => new Share(share))
.sort((a, b) => b.createdTime - a.createdTime)
.sort((a, b) => {
const localCompare = a.title.localeCompare(b.title)
if (localCompare !== 0) {
return localCompare
}
return b.createdTime - a.createdTime
})
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)

File diff suppressed because one or more lines are too long

1
dist/6880-6880.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/6880-6880.js.map.license vendored Symbolic link
View file

@ -0,0 +1 @@
6880-6880.js.license

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
9549-9549.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long