瀏覽代碼

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