Skip to content

Commit e09a6eb

Browse files
2larAndyScherzinger
authored andcommitted
adding branching feature
1 parent 250084f commit e09a6eb

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

apps/files_sharing/src/views/SharingTab.vue

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -275,20 +275,24 @@ export default {
275275
* @param {object} share the share ocs api request data
276276
* @param {object} share.data the request data
277277
*/
278-
processShares({ data }) {
279-
if (data.ocs && data.ocs.data && data.ocs.data.length > 0) {
280-
// create Share objects and sort by newest
281-
const shares = data.ocs.data
282-
.map(share => new Share(share))
283-
.sort((a, b) => b.createdTime - a.createdTime)
284-
285-
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
286-
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)
287-
288-
console.debug('Processed', this.linkShares.length, 'link share(s)')
289-
console.debug('Processed', this.shares.length, 'share(s)')
290-
}
291-
},
278+
processShares({ data }) {
279+
if (data.ocs && data.ocs.data && data.ocs.data.length > 0) {
280+
// create Share objects and sort by title in alphabetical order and then by creation time
281+
const shares = data.ocs.data
282+
.map(share => new Share(share))
283+
.sort((a, b) => {
284+
if (a.title < b.title) return -1
285+
if (a.title > b.title) return 1
286+
return b.createdTime - a.createdTime
287+
})
288+
289+
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
290+
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)
291+
292+
console.debug('Processed', this.linkShares.length, 'link share(s)')
293+
console.debug('Processed', this.shares.length, 'share(s)')
294+
}
295+
},
292296
293297
/**
294298
* Process the sharedWithMe share data

0 commit comments

Comments
 (0)