Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes destination when joining space to explore space rooms #5766

Merged
merged 5 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5766.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changes destination after joining a space to Explore Space Rooms screen
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down