Ver código fonte

disable "mark all read" button when it does nothing

This also helps with understanding what it does,
because you can now only click it if there are messages that can be marked as read.
Simon Laux 2 anos atrás
pai
commit
7908dd06bb
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      deltachat-ios/Controller/ChatListController.swift

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

@@ -674,6 +674,7 @@ class ChatListController: UITableViewController {
         }
         titleView.isUserInteractionEnabled = !tableView.isEditing
         titleView.sizeToFit()
+        updateMarkArchivedReadButton()
     }
 
     func handleMultiSelectionTitle() -> Bool {
@@ -703,6 +704,11 @@ class ChatListController: UITableViewController {
                 self.handleEmptyStateLabel()
             }
         }
+        updateMarkArchivedReadButton()
+    }
+    
+    func updateMarkArchivedReadButton(){
+        self.markArchivedReadButton.isEnabled = dcContext.getUnreadMessages(chatId: Int(DC_CHAT_ID_ARCHIVED_LINK)) != 0
     }
 
     private func handleEmptyStateLabel() {