diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index ea25149b97e01..dbc872a395135 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -254,12 +254,14 @@ export default { * @param {object} share the share ocs api request data * @param {object} share.data the request data */ + processShares({ data }) { + if (data.ocs && data.ocs.data && data.ocs.data.length > 0) { // create Share objects and sort by newest const shares = data.ocs.data .map(share => new Share(share)) - .sort((a, b) => b.createdTime - a.createdTime) + .sort((a, b) => ((a.title.localeCompare(b.title)) === 0 ? (b.createdTime - a.createdTime) : (a.title.localeCompare(b.title))),) 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)