Browse Source

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 years ago
parent
commit
7908dd06bb
1 changed files with 6 additions and 0 deletions
  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() {