瀏覽代碼

show archive on click on archive-link

B. Petersen 5 年之前
父節點
當前提交
1ead26c810
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 1 1
      deltachat-ios/Controller/ChatListController.swift
  2. 8 0
      deltachat-ios/Coordinator/AppCoordinator.swift

+ 1 - 1
deltachat-ios/Controller/ChatListController.swift

@@ -171,7 +171,7 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
         let row = indexPath.row
         if let chatId = chatList?.getChatId(index: row) {
             if chatId==DC_CHAT_ID_ARCHIVED_LINK {
-                // TODO
+                coordinator?.showArchive()
             } else {
                 coordinator?.showChat(chatId: chatId)
             }

+ 8 - 0
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -230,6 +230,14 @@ class ChatListCoordinator: Coordinator {
         chatVC.coordinator = coordinator
         navigationController.pushViewController(chatVC, animated: true)
     }
+
+    func showArchive() {
+        let controller = ChatListController(dcContext: dcContext, showArchive: true)
+        let coordinator = ChatListCoordinator(dcContext: dcContext, navigationController: navigationController)
+        childCoordinators.append(coordinator)
+        controller.coordinator = coordinator
+        navigationController.pushViewController(controller, animated: true)
+    }
 }
 
 class SettingsCoordinator: Coordinator {