File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
apps/files_sharing/src/views Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -277,11 +277,16 @@ export default {
277
277
*/
278
278
processShares ({ data }) {
279
279
if (data .ocs && data .ocs .data && data .ocs .data .length > 0 ) {
280
- // create Share objects and sort by newest
280
+ // create Share objects and sort by title in alphabetical order and then by creation time
281
281
const shares = data .ocs .data
282
282
.map (share => new Share (share))
283
- .sort ((a , b ) => b .createdTime - a .createdTime )
284
-
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
+ })
285
290
this .linkShares = shares .filter (share => share .type === this .SHARE_TYPES .SHARE_TYPE_LINK || share .type === this .SHARE_TYPES .SHARE_TYPE_EMAIL )
286
291
this .shares = shares .filter (share => share .type !== this .SHARE_TYPES .SHARE_TYPE_LINK && share .type !== this .SHARE_TYPES .SHARE_TYPE_EMAIL )
287
292
You can’t perform that action at this time.
0 commit comments