From a684ea37146a9a2fb8a63c9dfc725dfa8d598852 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Tue, 16 Jan 2024 22:56:24 +0100 Subject: [PATCH] Clicking a parent space should switch to it even if already selected Change-Id: Ic7066e17a1c649a1c7a0384bbb247cc30b13e590 --- .../main/kotlin/chat/schildi/features/roomlist/SpacesPager.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/roomlist/impl/src/main/kotlin/chat/schildi/features/roomlist/SpacesPager.kt b/features/roomlist/impl/src/main/kotlin/chat/schildi/features/roomlist/SpacesPager.kt index a1a9547722..c118a56c6f 100644 --- a/features/roomlist/impl/src/main/kotlin/chat/schildi/features/roomlist/SpacesPager.kt +++ b/features/roomlist/impl/src/main/kotlin/chat/schildi/features/roomlist/SpacesPager.kt @@ -131,6 +131,10 @@ private fun SpacesPager( if (selectedSpaceIndex == index) { if (expandSpaceChildren) { expandSpaceChildren = false + // In case we selected a child, need to re-select this space + if (childSelections.isNotEmpty()) { + selectSpace(spacesList[index], parentSelection) + } } else if (space.spaces.isNotEmpty()) { expandSpaceChildren = true }