Jelajahi Sumber

removed animation when navigating to restored chat

nayooti 5 tahun lalu
induk
melakukan
38eb3c4c72

+ 3 - 3
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -88,7 +88,7 @@ class AppCoordinator: NSObject, Coordinator {
         } else {
             showTab(index: lastActiveTab)
             if let lastActiveChatId = appStateRestorer.restoreLastActiveChatId(), lastActiveTab == 1 {
-                showChat(chatId: lastActiveChatId)
+                showChat(chatId: lastActiveChatId, animated: false)
             }
         }
     }
@@ -97,7 +97,7 @@ class AppCoordinator: NSObject, Coordinator {
         tabBarController.selectedIndex = index
     }
 
-    func showChat(chatId: Int) {
+    func showChat(chatId: Int, animated: Bool = true) {
         showTab(index: chatsTab)
         guard let navController = self.chatListController as? UINavigationController else {
             assertionFailure("huh? why no nav controller?")
@@ -106,7 +106,7 @@ class AppCoordinator: NSObject, Coordinator {
         let chatVC = ChatViewController(dcContext: dcContext, chatId: chatId)
         let coordinator = ChatViewCoordinator(dcContext: dcContext, navigationController: navController, chatId: chatId)
         chatVC.coordinator = coordinator
-        navController.pushViewController(chatVC, animated: true)
+        navController.pushViewController(chatVC, animated: animated)
     }
 
     func handleQRCode(_ code: String) {

+ 0 - 2
deltachat-ios/Handler/AppStateRestorer.swift

@@ -40,11 +40,9 @@ class AppStateRestorer: NSObject, UITabBarControllerDelegate {
         let activeTab = tabBarController.selectedIndex + offsetKey
 
         if let tab = Tab(rawValue: activeTab), tab != .chatTab {
-            // reset last active chat
             resetLastActiveChat()
         }
 
-
         UserDefaults.standard.set(activeTab, forKey: lastActiveTabKey)
         UserDefaults.standard.synchronize()
     }