فهرست منبع

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() {