aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/views/SharingTab.vue
diff options
context:
space:
mode:
author2lar <lawrencelkim@gmail.com>2023-04-21 14:45:36 -0400
committerskjnldsv <skjnldsv@protonmail.com>2024-08-07 11:39:54 +0200
commit6cf1aed93acea3767b7c938aa4e201921d29937d (patch)
treec0128cf631ab92bb0a1245a4f2e5f2d2f844c011 /apps/files_sharing/src/views/SharingTab.vue
parentcb341fc64cd817e719a09818b3f047c1e05c9eee (diff)
downloadnextcloud-server-6cf1aed93acea3767b7c938aa4e201921d29937d.tar.gz
nextcloud-server-6cf1aed93acea3767b7c938aa4e201921d29937d.zip
fix(files_sharing): tab shares title and creation sort
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/src/views/SharingTab.vue')
-rw-r--r--apps/files_sharing/src/views/SharingTab.vue11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue
index 070c1b508e4..139b137453a 100644
--- a/apps/files_sharing/src/views/SharingTab.vue
+++ b/apps/files_sharing/src/views/SharingTab.vue
@@ -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)