vector-im/element-meta/issues/2213 - Automatically pop the invites list when acting on the last one. Coming back from the room will go directly back to the room list

This commit is contained in:
Stefan Ceriu 2023-11-24 15:01:04 +02:00 committed by Stefan Ceriu
parent 07eccbee8c
commit 59eb253980
2 changed files with 15 additions and 0 deletions

View File

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

View File

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