cyberta 5 lat temu
rodzic
commit
730da85397

+ 1 - 1
deltachat-ios/AppDelegate.swift

@@ -126,7 +126,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     }
 
     func open() {
-        guard let databaseLocation = DatabaseHelper().testMove(toShared: true) else {
+        guard let databaseLocation = DatabaseHelper().updateDatabaseLocation() else {
             fatalError("Database could not be opened")
         }
         logger.info("open: \(databaseLocation)")

+ 11 - 11
deltachat-ios/Helper/DatabaseHelper.swift

@@ -38,19 +38,19 @@ class DatabaseHelper {
     }
 
     func clearSharedDbBlobsDir() {
-      let fileManager = FileManager.default
-      do {
-        if fileManager.fileExists(atPath: sharedDbBlobsDir) {
-            let filePaths =  try fileManager.contentsOfDirectory(atPath: sharedDbBlobsDir)
-            for filePath in filePaths {
-                let completePath = URL(fileURLWithPath: sharedDbBlobsDir).appendingPathComponent(filePath)
-                try fileManager.removeItem(atPath: completePath.path)
+        let fileManager = FileManager.default
+        do {
+            if fileManager.fileExists(atPath: sharedDbBlobsDir) {
+                let filePaths =  try fileManager.contentsOfDirectory(atPath: sharedDbBlobsDir)
+                for filePath in filePaths {
+                    let completePath = URL(fileURLWithPath: sharedDbBlobsDir).appendingPathComponent(filePath)
+                    try fileManager.removeItem(atPath: completePath.path)
+                }
+                try fileManager.removeItem(atPath: sharedDbBlobsDir)
             }
-            try fileManager.removeItem(atPath: sharedDbBlobsDir)
-        }
-      } catch {
+        } catch {
           logger.error("Could not clean shared blobs dir, it might be it didn't exist")
-      }
+        }
     }
 
     func clearSharedDb() {