Rename var
This commit is contained in:
parent
29dc114d1a
commit
97702317dd
|
@ -141,33 +141,33 @@ class SpaceSummaryController @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
rootSpaces
|
rootSpaces
|
||||||
?.forEach { groupSummary ->
|
?.forEach { roomSummary ->
|
||||||
val isSelected = selected is RoomGroupingMethod.BySpace && groupSummary.roomId == selected.space()?.roomId
|
val isSelected = selected is RoomGroupingMethod.BySpace && roomSummary.roomId == selected.space()?.roomId
|
||||||
// does it have children?
|
// does it have children?
|
||||||
val subSpaces = groupSummary.spaceChildren?.filter { childInfo ->
|
val subSpaces = roomSummary.spaceChildren?.filter { childInfo ->
|
||||||
summaries?.any { it.roomId == childInfo.childRoomId }.orFalse()
|
summaries?.any { it.roomId == childInfo.childRoomId }.orFalse()
|
||||||
}?.sortedWith(subSpaceComparator)
|
}?.sortedWith(subSpaceComparator)
|
||||||
val hasChildren = (subSpaces?.size ?: 0) > 0
|
val hasChildren = (subSpaces?.size ?: 0) > 0
|
||||||
val expanded = expandedStates[groupSummary.roomId] == true
|
val expanded = expandedStates[roomSummary.roomId] == true
|
||||||
|
|
||||||
spaceSummaryItem {
|
spaceSummaryItem {
|
||||||
avatarRenderer(host.avatarRenderer)
|
avatarRenderer(host.avatarRenderer)
|
||||||
id(groupSummary.roomId)
|
id(roomSummary.roomId)
|
||||||
hasChildren(hasChildren)
|
hasChildren(hasChildren)
|
||||||
expanded(expanded)
|
expanded(expanded)
|
||||||
// to debug order
|
// to debug order
|
||||||
// matrixItem(groupSummary.copy(displayName = "${groupSummary.displayName} / ${spaceOrderInfo?.get(groupSummary.roomId)}")
|
// matrixItem(groupSummary.copy(displayName = "${groupSummary.displayName} / ${spaceOrderInfo?.get(groupSummary.roomId)}")
|
||||||
// .toMatrixItem())
|
// .toMatrixItem())
|
||||||
matrixItem(groupSummary.toMatrixItem())
|
matrixItem(roomSummary.toMatrixItem())
|
||||||
selected(isSelected)
|
selected(isSelected)
|
||||||
canDrag(true)
|
canDrag(true)
|
||||||
onMore { host.callback?.onSpaceSettings(groupSummary) }
|
onMore { host.callback?.onSpaceSettings(roomSummary) }
|
||||||
listener { host.callback?.onSpaceSelected(groupSummary) }
|
listener { host.callback?.onSpaceSelected(roomSummary) }
|
||||||
toggleExpand { host.callback?.onToggleExpand(groupSummary) }
|
toggleExpand { host.callback?.onToggleExpand(roomSummary) }
|
||||||
countState(
|
countState(
|
||||||
UnreadCounterBadgeView.State(
|
UnreadCounterBadgeView.State(
|
||||||
groupSummary.notificationCount,
|
roomSummary.notificationCount,
|
||||||
groupSummary.highlightCount > 0
|
roomSummary.highlightCount > 0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class SpaceSummaryController @Inject constructor(
|
||||||
if (hasChildren && expanded) {
|
if (hasChildren && expanded) {
|
||||||
// it's expanded
|
// it's expanded
|
||||||
subSpaces?.forEach { child ->
|
subSpaces?.forEach { child ->
|
||||||
buildSubSpace(groupSummary.roomId, summaries, expandedStates, selected, child, 1, 3)
|
buildSubSpace(roomSummary.roomId, summaries, expandedStates, selected, child, 1, 3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue