Browse Source

smarter delete with fewer noise on the screen

B. Petersen 3 years ago
parent
commit
b5f4982cca

+ 1 - 1
deltachat-ios/Chat/ChatViewController.swift

@@ -840,7 +840,7 @@ class ChatViewController: UITableViewController {
     private func updateTitle(chat: DcChat) {
         let titleView =  ChatTitleView()
 
-        var subtitle = "ErrSubtitle"
+        var subtitle = ""
         let chatContactIds = chat.getContactIds(dcContext)
         if chat.isMailinglist {
             subtitle = String.localized("mailing_list")

+ 1 - 6
deltachat-ios/Controller/ContactDetailViewController.swift

@@ -520,12 +520,7 @@ class ContactDetailViewController: UITableViewController {
         NotificationManager.removeNotificationsForChat(dcContext: viewModel.context, chatId: viewModel.chatId)
         INInteraction.delete(with: ["\(viewModel.context.id).\(viewModel.chatId)"])
 
-        // just pop to viewControllers - we've in chatlist or archive then
-        // (no not use `navigationController?` here: popping self will make the reference becoming nil)
-        if let navigationController = navigationController {
-            navigationController.popViewController(animated: false)
-            navigationController.popViewController(animated: true)
-        }
+        navigationController?.popViewControllers(viewsToPop: 2, animated: true)
     }
 }
 

+ 1 - 6
deltachat-ios/Controller/GroupChatDetailViewController.swift

@@ -415,12 +415,7 @@ class GroupChatDetailViewController: UIViewController {
         NotificationManager.removeNotificationsForChat(dcContext: dcContext, chatId: chatId)
         INInteraction.delete(with: ["\(dcContext.id).\(chatId)"])
 
-        // just pop to viewControllers - we've in chatlist or archive then
-        // (no not use `navigationController?` here: popping self will make the reference becoming nil)
-        if let navigationController = navigationController {
-            navigationController.popViewController(animated: false)
-            navigationController.popViewController(animated: true)
-        }
+        navigationController?.popViewControllers(viewsToPop: 2, animated: true)
     }
 
     private func showGroupAvatarIfNeeded() {