浏览代码

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

cyberta 4 年之前
父节点
当前提交
a1ac3ab495
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      deltachat-ios/AppDelegate.swift

+ 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)
         }
     }