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

also add a check for closed context in reloadDcContext

Simon Laux преди 2 години
родител
ревизия
9145e237b2
променени са 2 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 5 1
      deltachat-ios/AppDelegate.swift
  2. 1 1
      deltachat-ios/Controller/ClosedAccountErrorViewController.swift

+ 5 - 1
deltachat-ios/AppDelegate.swift

@@ -560,7 +560,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         notificationManager.reloadDcContext()
         notificationManager.reloadDcContext()
         RelayHelper.shared.cancel()
         RelayHelper.shared.cancel()
         _ = RelayHelper.setup(dcAccounts.getSelected())
         _ = RelayHelper.setup(dcAccounts.getSelected())
-        if dcAccounts.getSelected().isConfigured() {
+        
+        let context = dcAccounts.getSelected()
+        if !context.isOpen() {
+            appCoordinator.presentClosedAccountController()
+        } else if context.isConfigured() {
             appCoordinator.resetTabBarRootViewControllers()
             appCoordinator.resetTabBarRootViewControllers()
         } else {
         } else {
             appCoordinator.presentWelcomeController()
             appCoordinator.presentWelcomeController()

+ 1 - 1
deltachat-ios/Controller/ClosedAccountErrorViewController.swift

@@ -97,7 +97,7 @@ class ClosedAccountErrorViewController: UIViewController {
         }
         }
         
         
         if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
         if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
-            appDelegate.appCoordinator.initializeRootController()
+            appDelegate.reloadDcContext()
         }
         }
     }
     }