diff --git a/changelog.d/5766.bugfix b/changelog.d/5766.bugfix new file mode 100644 index 0000000000..d3290decab --- /dev/null +++ b/changelog.d/5766.bugfix @@ -0,0 +1 @@ +Changes destination after joining a space to Explore Space Rooms screen diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index 9d3f022e53..7a8dcf2634 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -580,7 +580,7 @@ class HomeActivity : } override fun spaceInviteBottomSheetOnAccept(spaceId: String) { - navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.None) + navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.OpenRoomList) } override fun spaceInviteBottomSheetOnDecline(spaceId: String) { @@ -613,6 +613,6 @@ class HomeActivity : } override fun mxToBottomSheetSwitchToSpace(spaceId: String) { - navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.None) + navigator.switchToSpace(this, spaceId, Navigator.PostSwitchSpaceAction.OpenRoomList) } } diff --git a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt index 8ff70c2954..6122cf1eee 100644 --- a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt @@ -176,6 +176,9 @@ class DefaultNavigator @Inject constructor( Navigator.PostSwitchSpaceAction.OpenAddExistingRooms -> { startActivity(context, SpaceManageActivity.newIntent(context, spaceId, ManageType.AddRooms), false) } + Navigator.PostSwitchSpaceAction.OpenRoomList -> { + startActivity(context, SpaceExploreActivity.newIntent(context, spaceId), buildTask = false) + } is Navigator.PostSwitchSpaceAction.OpenDefaultRoom -> { val args = TimelineArgs( postSwitchSpaceAction.roomId, diff --git a/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt b/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt index 85826fad5b..310105bd95 100644 --- a/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt +++ b/vector/src/main/java/im/vector/app/features/navigation/Navigator.kt @@ -54,8 +54,9 @@ interface Navigator { sealed class PostSwitchSpaceAction { object None : PostSwitchSpaceAction() - data class OpenDefaultRoom(val roomId: String, val showShareSheet: Boolean) : PostSwitchSpaceAction() object OpenAddExistingRooms : PostSwitchSpaceAction() + object OpenRoomList : PostSwitchSpaceAction() + data class OpenDefaultRoom(val roomId: String, val showShareSheet: Boolean) : PostSwitchSpaceAction() } fun switchToSpace(context: Context, spaceId: String, postSwitchSpaceAction: PostSwitchSpaceAction)