Browse Source

update mute icon on CHAT_MODIFIED

check if an update is needed,
if so, call updateTitle()

nb: updateTitle() is done on viewWillAppear(),
however, self.dcChat is not always up to date at that point,
this is not changed by this pr:
in general, we should aim to avoid updates on subsequent shows anyway
and let all updates be driven by events
as this makes navigation between controller much faster
and also allows the state to be changed by other reasons.
B. Petersen 2 năm trước cách đây
mục cha
commit
dca0caaac9
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      deltachat-ios/Chat/ChatViewController.swift

+ 6 - 0
deltachat-ios/Chat/ChatViewController.swift

@@ -617,6 +617,12 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
                         self.messageInputBar.isHidden = true
                     }
                 }
+
+                let oldMuted = self.navigationItem.rightBarButtonItems?.contains(self.muteItem)
+                let newMuted = self.dcChat.isMuted
+                if oldMuted != newMuted {
+                    self.updateTitle()
+                }
             }
         }