Merge pull request #5766 from vector-im/bugfix/eric/joining-space-landing

Changes destination when joining space to explore space rooms
This commit is contained in:
Eric Decanini 2022-04-14 17:58:31 +02:00 committed by GitHub
commit ace8ae6a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

1
changelog.d/5766.bugfix Normal file
View File

@ -0,0 +1 @@
Changes destination after joining a space to Explore Space Rooms screen

View File

@ -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)
}
}

View File

@ -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,

View File

@ -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)