@@ -275,20 +275,24 @@ export default {
275
275
* @param {object} share the share ocs api request data
276
276
* @param {object} share.data the request data
277
277
*/
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
+ },
292
296
293
297
/**
294
298
* Process the sharedWithMe share data
0 commit comments