Эх сурвалжийг харах

remove search from archive list

nayooti 5 жил өмнө
parent
commit
e49d0be259

+ 8 - 2
deltachat-ios/Controller/ChatListController.swift

@@ -41,7 +41,11 @@ class ChatListController: UITableViewController {
 
     init(viewModel: ChatListViewModelProtocol) {
         self.viewModel = viewModel
-        super.init(style: .grouped)
+        if viewModel.isArchive {
+            super.init(nibName: nil, bundle: nil)
+        } else {
+            super.init(style: .grouped)
+        }
         viewModel.onChatListUpdate = handleChatListUpdate // register listener
     }
 
@@ -53,7 +57,9 @@ class ChatListController: UITableViewController {
     override func viewDidLoad() {
         super.viewDidLoad()
         navigationItem.rightBarButtonItem = newButton
-        navigationItem.searchController = searchController
+        if !viewModel.isArchive {
+            navigationItem.searchController = searchController
+        }
         configureTableView()
     }
 

+ 2 - 1
deltachat-ios/ViewModel/ChatListViewModel.swift

@@ -11,7 +11,8 @@ protocol ChatListViewModelProtocol: class, UISearchResultsUpdating {
     func cellDataFor(section: Int, row: Int) -> AvatarCellViewModel
 
     func msgIdFor(row: Int) -> Int?
-    func chatIdFor(section: Int, row: Int) -> Int? // to differentiate betweeen deaddrop / archive / default
+    func chatIdFor(section: Int, row: Int) -> Int? // needed to differentiate betweeen deaddrop / archive / default
+
     // search related
     var searchActive: Bool { get }
     func beginFiltering()