@@ -275,24 +275,25 @@ 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 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
- },
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
+ const localCompare = a .title .localeCompare (b .title )
285
+ if (localCompare !== 0 ) {
286
+ return localCompare
287
+ }
288
+ return b .createdTime - a .createdTime
289
+ })
290
+ this .linkShares = shares .filter (share => share .type === this .SHARE_TYPES .SHARE_TYPE_LINK || share .type === this .SHARE_TYPES .SHARE_TYPE_EMAIL )
291
+ this .shares = shares .filter (share => share .type !== this .SHARE_TYPES .SHARE_TYPE_LINK && share .type !== this .SHARE_TYPES .SHARE_TYPE_EMAIL )
292
+
293
+ console .debug (' Processed' , this .linkShares .length , ' link share(s)' )
294
+ console .debug (' Processed' , this .shares .length , ' share(s)' )
295
+ }
296
+ },
296
297
297
298
/**
298
299
* Process the sharedWithMe share data
0 commit comments