Эх сурвалжийг харах

Delete all shortcuts on database migration to DcAccounts. This way we avoid stale siri shortcut entries

cyberta 4 жил өмнө
parent
commit
a1ac3ab495

+ 7 - 4
deltachat-ios/AppDelegate.swift

@@ -6,6 +6,7 @@ import UserNotifications
 import DcCore
 import DBDebugToolkit
 import SDWebImageWebPCoder
+import Intents
 
 let logger = SwiftyBeaver.self
 
@@ -452,10 +453,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
     func migrateToDcAccounts() {
         let dbHelper = DatabaseHelper()
-        if let databaseLocation = dbHelper.unmanagedDatabaseLocation,
-           dcAccounts.migrate(dbLocation: databaseLocation) == 0 {
-                fatalError("Account could not be migrated")
-                // TODO: show error message in UI
+        if let databaseLocation = dbHelper.unmanagedDatabaseLocation {
+            if dcAccounts.migrate(dbLocation: databaseLocation) == 0 {
+                 fatalError("Account could not be migrated")
+                 // TODO: show error message in UI
+            }
+            INInteraction.deleteAll(completion: nil)
         }
     }