소스 검색

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()
+                }
             }
         }