浏览代码

Merge pull request #1381 from deltachat/smarter-delete

smarter delete with fewer noise on the screen
bjoern 3 年之前
父节点
当前提交
557f0ed86c

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

@@ -866,7 +866,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

@@ -434,12 +434,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() {