From 97702317dd4f0290a4a79f2fa25e1d2d6cac4b1a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 4 May 2022 10:03:53 +0200 Subject: [PATCH] Rename var --- .../features/spaces/SpaceSummaryController.kt | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt index 11f0501c03..010a5965a9 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt @@ -141,33 +141,33 @@ class SpaceSummaryController @Inject constructor( } rootSpaces - ?.forEach { groupSummary -> - val isSelected = selected is RoomGroupingMethod.BySpace && groupSummary.roomId == selected.space()?.roomId + ?.forEach { roomSummary -> + val isSelected = selected is RoomGroupingMethod.BySpace && roomSummary.roomId == selected.space()?.roomId // does it have children? - val subSpaces = groupSummary.spaceChildren?.filter { childInfo -> + val subSpaces = roomSummary.spaceChildren?.filter { childInfo -> summaries?.any { it.roomId == childInfo.childRoomId }.orFalse() }?.sortedWith(subSpaceComparator) val hasChildren = (subSpaces?.size ?: 0) > 0 - val expanded = expandedStates[groupSummary.roomId] == true + val expanded = expandedStates[roomSummary.roomId] == true spaceSummaryItem { avatarRenderer(host.avatarRenderer) - id(groupSummary.roomId) + id(roomSummary.roomId) hasChildren(hasChildren) expanded(expanded) // to debug order // matrixItem(groupSummary.copy(displayName = "${groupSummary.displayName} / ${spaceOrderInfo?.get(groupSummary.roomId)}") // .toMatrixItem()) - matrixItem(groupSummary.toMatrixItem()) + matrixItem(roomSummary.toMatrixItem()) selected(isSelected) canDrag(true) - onMore { host.callback?.onSpaceSettings(groupSummary) } - listener { host.callback?.onSpaceSelected(groupSummary) } - toggleExpand { host.callback?.onToggleExpand(groupSummary) } + onMore { host.callback?.onSpaceSettings(roomSummary) } + listener { host.callback?.onSpaceSelected(roomSummary) } + toggleExpand { host.callback?.onToggleExpand(roomSummary) } countState( UnreadCounterBadgeView.State( - groupSummary.notificationCount, - groupSummary.highlightCount > 0 + roomSummary.notificationCount, + roomSummary.highlightCount > 0 ) ) } @@ -175,7 +175,7 @@ class SpaceSummaryController @Inject constructor( if (hasChildren && expanded) { // it's expanded subSpaces?.forEach { child -> - buildSubSpace(groupSummary.roomId, summaries, expandedStates, selected, child, 1, 3) + buildSubSpace(roomSummary.roomId, summaries, expandedStates, selected, child, 1, 3) } } }