Skip to content

Commit 48ac256

Browse files
2larAltahrim
authored andcommitted
fix(files_sharing): tab shares title and creation sort
Signed-off-by: Benjamin Gaussorgues <[email protected]>
1 parent c423973 commit 48ac256

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

apps/files_sharing/src/views/SharingTab.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,16 @@ export default {
277277
*/
278278
processShares({ data }) {
279279
if (data.ocs && data.ocs.data && data.ocs.data.length > 0) {
280-
// create Share objects and sort by newest
280+
// create Share objects and sort by title in alphabetical order and then by creation time
281281
const shares = data.ocs.data
282282
.map(share => new Share(share))
283-
.sort((a, b) => b.createdTime - a.createdTime)
284-
283+
.sort((a, b) => {
284+
const localCompare = a.title.localeCompare(b.title)
285+
if (localCompare !== 0) {
286+
return localCompare
287+
}
288+
return b.createdTime - a.createdTime
289+
})
285290
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
286291
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)
287292

0 commit comments

Comments
 (0)