|
@@ -72,6 +72,7 @@ class ChatListController: UITableViewController {
|
|
viewModel.refreshData()
|
|
viewModel.refreshData()
|
|
|
|
|
|
if RelayHelper.sharedInstance.isForwarding() {
|
|
if RelayHelper.sharedInstance.isForwarding() {
|
|
|
|
+ quitSearch(animated: false)
|
|
tableView.scrollToTop()
|
|
tableView.scrollToTop()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -146,6 +147,16 @@ class ChatListController: UITableViewController {
|
|
updateTitle()
|
|
updateTitle()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private func quitSearch(animated: Bool) {
|
|
|
|
+ searchController.searchBar.text = nil
|
|
|
|
+ self.viewModel.endSearch()
|
|
|
|
+ searchController.dismiss(animated: animated) {
|
|
|
|
+ self.tableView.scrollToTop()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // MARK: - UITableViewDelegate + UITableViewDatasource
|
|
|
|
+
|
|
override func numberOfSections(in tableView: UITableView) -> Int {
|
|
override func numberOfSections(in tableView: UITableView) -> Int {
|
|
return viewModel.numberOfSections
|
|
return viewModel.numberOfSections
|
|
}
|
|
}
|
|
@@ -160,7 +171,7 @@ class ChatListController: UITableViewController {
|
|
let cellData = viewModel.cellDataFor(section: indexPath.section, row: indexPath.row)
|
|
let cellData = viewModel.cellDataFor(section: indexPath.section, row: indexPath.row)
|
|
|
|
|
|
switch cellData.type {
|
|
switch cellData.type {
|
|
- case .deaddrop(let deaddropData):
|
|
|
|
|
|
+ case .deaddrop:
|
|
guard let deaddropCell = tableView.dequeueReusableCell(withIdentifier: deadDropCellReuseIdentifier, for: indexPath) as? ContactCell else {
|
|
guard let deaddropCell = tableView.dequeueReusableCell(withIdentifier: deadDropCellReuseIdentifier, for: indexPath) as? ContactCell else {
|
|
break
|
|
break
|
|
}
|
|
}
|
|
@@ -355,6 +366,7 @@ extension ChatListController: UISearchBarDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
|
|
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
|
|
|
|
+ // searchBar will be set to "" by system
|
|
viewModel.endSearch()
|
|
viewModel.endSearch()
|
|
}
|
|
}
|
|
}
|
|
}
|