Explorar o código

moved update functions in chatView from viewDidLoad to viewDidAppear since to keep up to date to changes made in chatDetail

Bastian van de Wetering %!s(int64=6) %!d(string=hai) anos
pai
achega
adb87fcc6a
Modificáronse 1 ficheiros con 11 adicións e 11 borrados
  1. 11 11
      deltachat-ios/Controller/ChatViewController.swift

+ 11 - 11
deltachat-ios/Controller/ChatViewController.swift

@@ -55,17 +55,6 @@ class ChatViewController: MessagesViewController {
       // TODO: display message about nothing being configured
       return
     }
-
-    let chat = MRChat(id: chatId)
-    updateTitleView(title: chat.name, subtitle: chat.subtitle)
-
-    if let image = chat.profileImage {
-      navigationItem.rightBarButtonItem = UIBarButtonItem(image: image, style: .done, target: self, action: #selector(chatProfilePressed))
-    } else {
-      let initialsLabel = InitialsLabel(name: chat.name, color: chat.color, size: 28)
-      navigationItem.rightBarButtonItem = UIBarButtonItem(customView: initialsLabel)
-    }
-
     configureMessageCollectionView()
 
     if !disableWriting {
@@ -83,6 +72,17 @@ class ChatViewController: MessagesViewController {
 		// this will be removed in viewWillDisappear
 		navigationController?.navigationBar.addGestureRecognizer(navBarTap)
 
+		let chat = MRChat(id: chatId)
+		updateTitleView(title: chat.name, subtitle: chat.subtitle)
+
+		if let image = chat.profileImage {
+			navigationItem.rightBarButtonItem = UIBarButtonItem(image: image, style: .done, target: self, action: #selector(chatProfilePressed))
+		} else {
+			let initialsLabel = InitialsLabel(name: chat.name, color: chat.color, size: 28)
+			navigationItem.rightBarButtonItem = UIBarButtonItem(customView: initialsLabel)
+		}
+
+
     configureMessageMenu()
 
     if #available(iOS 11.0, *) {