瀏覽代碼

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 年之前
父節點
當前提交
7908dd06bb
共有 1 個文件被更改,包括 6 次插入0 次删除
  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() {