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 năm trước cách đây
mục cha
commit
7908dd06bb
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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() {