Removes max depth on subspaces

This commit is contained in:
ericdecanini 2022-08-22 14:34:44 +02:00
parent a1c79f8c13
commit 4c404ca4ce

View File

@ -113,7 +113,7 @@ class NewSpaceSummaryController @Inject constructor(
if (hasChildren && expanded) { if (hasChildren && expanded) {
subSpaces?.forEach { child -> subSpaces?.forEach { child ->
addSubSpace(spaceSummary.roomId, spaceSummaries, expandedStates, selectedSpace, child, 1, 3) addSubSpace(spaceSummary.roomId, spaceSummaries, expandedStates, selectedSpace, child, 1)
} }
} }
} }
@ -127,11 +127,9 @@ class NewSpaceSummaryController @Inject constructor(
expandedStates: Map<String, Boolean>, expandedStates: Map<String, Boolean>,
selectedSpace: RoomSummary?, selectedSpace: RoomSummary?,
info: SpaceChildInfo, info: SpaceChildInfo,
currentDepth: Int, depth: Int,
maxDepth: Int,
) { ) {
val host = this val host = this
if (currentDepth >= maxDepth) return
val childSummary = spaceSummaries?.firstOrNull { it.roomId == info.childRoomId } ?: return val childSummary = spaceSummaries?.firstOrNull { it.roomId == info.childRoomId } ?: return
val id = "$idPrefix:${childSummary.roomId}" val id = "$idPrefix:${childSummary.roomId}"
val countState = UnreadCounterBadgeView.State(childSummary.notificationCount, childSummary.highlightCount > 0) val countState = UnreadCounterBadgeView.State(childSummary.notificationCount, childSummary.highlightCount > 0)
@ -145,7 +143,7 @@ class NewSpaceSummaryController @Inject constructor(
countState(countState) countState(countState)
expanded(expanded) expanded(expanded)
hasChildren(!subSpaces.isNullOrEmpty()) hasChildren(!subSpaces.isNullOrEmpty())
indent(currentDepth) indent(depth)
matrixItem(childSummary.toMatrixItem()) matrixItem(childSummary.toMatrixItem())
onLongClickListener { host.callback?.onSpaceSettings(childSummary) } onLongClickListener { host.callback?.onSpaceSettings(childSummary) }
onSubSpaceSelectedListener { host.callback?.onSpaceSelected(childSummary) } onSubSpaceSelectedListener { host.callback?.onSpaceSelected(childSummary) }
@ -155,7 +153,7 @@ class NewSpaceSummaryController @Inject constructor(
if (expanded) { if (expanded) {
subSpaces?.forEach { subSpaces?.forEach {
addSubSpace(id, spaceSummaries, expandedStates, selectedSpace, it, currentDepth + 1, maxDepth) addSubSpace(id, spaceSummaries, expandedStates, selectedSpace, it, depth + 1)
} }
} }
} }