Dismiss the whole search tab and move back to the previous when when tapping the search field dismissal button.

This commit is contained in:
Stefan Ceriu
2026-09-16 09:58:13 +03:00
parent b8a867bbb4
commit eaa6a5ce25
2 changed files with 23 additions and 1 deletions
@@ -339,6 +339,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
handleAppRoute(.room(roomID: roomID, via: []), animated: true)
}
case .cancel:
// The search screen is also dismissed when leaving the tab, ignore it in that case.
guard navigationTabCoordinator.selectedTab == .search else { return }
// Return to the tab the user came from, but never back into search.
navigationTabCoordinator.selectedTab = navigationTabCoordinator.previousTab == .search ? .chats : navigationTabCoordinator.previousTab ?? .chats
}