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

vector-im/element-meta/issues/2213 - Automatically pop the invites li… #2165

Merged
merged 1 commit into from
Nov 24, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
switch action {
case .presentedRoom(let roomID):
analytics.signpost.beginRoomFlow(roomID)

let availableInvitesCount = userSession.clientProxy.inviteSummaryProvider?.roomListPublisher.value.count ?? 0
if case .invitesScreen = stateMachine.state, availableInvitesCount == 1 {
dismissInvitesList(animated: true)
}

stateMachine.processEvent(.selectRoom(roomID: roomID))
case .dismissedRoom:
stateMachine.processEvent(.deselectRoom)
Expand Down Expand Up @@ -521,6 +527,14 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
}
}

private func dismissInvitesList(animated: Bool) {
guard case .invitesScreen = stateMachine.state else {
fatalError()
}

sidebarNavigationStackCoordinator.pop(animated: animated)
}

// MARK: Calls

private func presentCallScreen(roomProxy: RoomProxyProtocol) {
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-2213.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Automatically pop the invites list when acting on the last one. Coming back from the room will go directly back to the room list