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

when tapping 'Chats' multiple times, end search #2239

Merged
merged 1 commit into from
Jul 16, 2024
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
3 changes: 2 additions & 1 deletion deltachat-ios/Controller/ChatListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ class ChatListViewController: UITableViewController {
tableView.rowHeight = ContactCell.cellHeight
}
}
private func quitSearch(animated: Bool) {

func quitSearch(animated: Bool) {
searchController.searchBar.text = nil
self.viewModel?.endSearch()
searchController.dismiss(animated: animated) {
Expand Down
7 changes: 6 additions & 1 deletion deltachat-ios/Coordinator/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,14 @@ extension AppCoordinator: UITabBarControllerDelegate {
// if the chatlist is already visible when tapping, scroll chatlist to top
if let navigationController = viewController as? UINavigationController,
let chatListViewController = navigationController.viewControllers.first as? ChatListViewController,
let viewModel = chatListViewController.viewModel,
let chatsTab = tabBarController.selectedViewController as? UINavigationController,
chatsTab.topViewController == chatListViewController {
chatListViewController.tableView.scrollToTop(animated: true)
if viewModel.searchActive {
chatListViewController.quitSearch(animated: true) // this includes scrollToTop()
} else {
chatListViewController.tableView.scrollToTop(animated: true)
}
}

return true
Expand Down
Loading