Explorar o código

allow unarchiving chats

B. Petersen %!s(int64=5) %!d(string=hai) anos
pai
achega
afd7bd80e4
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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
             // 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
         archive.backgroundColor = UIColor.lightGray