浏览代码

allow unarchiving chats

B. Petersen 5 年之前
父节点
当前提交
afd7bd80e4
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      deltachat-ios/Controller/ChatListController.swift

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

@@ -191,8 +191,12 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
             // see https://forums.developer.apple.com/thread/115030
         }
 
-        let archive = UITableViewRowAction(style: .destructive, title: String.localized("menu_archive_chat")) { [unowned self] _, _ in
-            self.dcContext.archiveChat(chatId: chatId, archive: true)
+        var title = String.localized("menu_archive_chat")
+        if showArchive {
+            title = String.localized("menu_unarchive_chat")
+        }
+        let archive = UITableViewRowAction(style: .destructive, title: title) { [unowned self] _, _ in
+            self.dcContext.archiveChat(chatId: chatId, archive: !self.showArchive)
         }
         archive.backgroundColor = UIColor.lightGray