Skip to content

Commit 3c49da8

Browse files
committed
fix: sort shares by display name only
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
1 parent 6f129f9 commit 3c49da8

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎owncloudApp/src/main/java/com/owncloud/android/presentation/sharing/GraphSharesAdapter.kt‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ class GraphSharesAdapter : RecyclerView.Adapter<GraphSharesAdapter.GraphShareVie
7373

7474
fun setShares(shares: List<MemberPermission>, roles: List<OCRole>) {
7575
this.rolesMap = roles.associate { it.id to it.displayName }
76-
val sortedShares = shares.sortedWith(
77-
compareByDescending<MemberPermission> { share -> roles.indexOfFirst { it.id in share.roles } }
78-
.thenBy { it.displayName }
79-
)
76+
val sortedShares = shares.sortedBy { it.displayName.lowercase() }
8077
val diffResult = DiffUtil.calculateDiff(GraphSharesDiffUtil(this.shares, sortedShares))
8178
this.shares = sortedShares
8279
diffResult.dispatchUpdatesTo(this)

0 commit comments

Comments
 (0)