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

fix(ios): use .default qos for encription

Andelf 3 жил өмнө
parent
commit
6bb72c1252

+ 4 - 4
ios/App/App/FileSync/FileSync.swift

@@ -225,13 +225,13 @@ public class FileSync: CAPPlugin, SyncDebugDelegate {
                   call.reject("required parameters: passphrase, content")
                   return
               }
-        guard let ciphertext = content.data(using: .utf8) else {
+        guard let plaintext = content.data(using: .utf8) else {
             call.reject("cannot decode ciphertext with utf8")
             return
         }
         call.keepAlive = true
-        DispatchQueue.global(qos: .background).async {
-            if let encrypted = AgeEncryption.encryptWithPassphrase(ciphertext, passphrase, armor: true) {
+        DispatchQueue.global(qos: .default).async {
+            if let encrypted = AgeEncryption.encryptWithPassphrase(plaintext, passphrase, armor: true) {
                 call.resolve(["data": String(data: encrypted, encoding: .utf8) as Any])
             } else {
                 call.reject("cannot encrypt with passphrase")
@@ -251,7 +251,7 @@ public class FileSync: CAPPlugin, SyncDebugDelegate {
             return
         }
         call.keepAlive = true
-        DispatchQueue.global(qos: .background).async {
+        DispatchQueue.global(qos: .default).async {
             if let decrypted = AgeEncryption.decryptWithPassphrase(ciphertext, passphrase) {
                 call.resolve(["data": String(data: decrypted, encoding: .utf8) as Any])
             } else {