Marino Faggiana 7 жил өмнө
parent
commit
157468421a

+ 1 - 1
iOSClient/Brand/Picker.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.20.6</string>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00006</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/PickerFileProvider.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.20.6</string>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00006</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.20.6</string>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00006</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -69,7 +69,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00006</string>
 	<key>Fabric</key>
 	<dict>
 		<key>APIKey</key>

+ 23 - 7
iOSClient/Networking/NCService.swift

@@ -130,18 +130,24 @@ class NCService: NSObject, OCNetworkingDelegate {
                 DispatchQueue.global().async {
                 
                     let address = capabilities!.themingBackground!.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!
+                    let fileName = "\(self.appDelegate.directoryUser!)/themingBackground.png"
+
                     guard let imageData = try? Data(contentsOf: URL(string: address)!) else {
+                        DispatchQueue.main.async {
+                            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+                        }
                         return
                     }
                     
                     guard let image = UIImage(data: imageData) else {
-                        let fileName = "\(self.appDelegate.directoryUser!)/themingBackground.png"
                         try? FileManager.default.removeItem(atPath: fileName)
+                        DispatchQueue.main.async {
+                            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+                        }
                         return
                     }
                     
                     if let data = UIImagePNGRepresentation(image) {
-                        let fileName = "\(self.appDelegate.directoryUser!)/themingBackground.png"
                         try? data.write(to: URL(fileURLWithPath: fileName))
                     }
                     
@@ -149,6 +155,10 @@ class NCService: NSObject, OCNetworkingDelegate {
                         self.appDelegate.settingThemingColorBrand()
                     }
                 }
+                
+            } else {
+                
+                self.appDelegate.settingThemingColorBrand()
             }
             
             // ------ SEARCH ------------------------------------------------------------------------
@@ -232,24 +242,30 @@ class NCService: NSObject, OCNetworkingDelegate {
             DispatchQueue.global(qos: .default).async {
                 
                 let address = "\(self.appDelegate.activeUrl!)/index.php/avatar/\(self.appDelegate.activeUser!)/128".addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!
+                let fileName = "\(self.appDelegate.directoryUser!)/avatar.png"
+
                 guard let imageData = try? Data(contentsOf: URL(string: address)!) else {
-                    NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeUserProfile"), object: nil)
+                    DispatchQueue.main.async {
+                        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeUserProfile"), object: nil)
+                    }
                     return
                 }
                 
                 guard let image = UIImage(data: imageData) else {
-                    let fileName = "\(self.appDelegate.directoryUser!)/avatar.png"
                     try? FileManager.default.removeItem(atPath: fileName)
-                    NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeUserProfile"), object: nil)
+                    DispatchQueue.main.async {
+                        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeUserProfile"), object: nil)
+                    }
                     return
                 }
                 
                 if let data = UIImagePNGRepresentation(image) {
-                    let fileName = "\(self.appDelegate.directoryUser!)/avatar.png"
                     try? data.write(to: URL(fileURLWithPath: fileName))
                 }
                 
-                NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeUserProfile"), object: nil)
+                DispatchQueue.main.async {
+                    NotificationCenter.default.post(name: NSNotification.Name(rawValue: "changeUserProfile"), object: nil)
+                }
             }
             
         } else {