Преглед на файлове

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