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

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 жил өмнө
parent
commit
55d28c5a4d

+ 4 - 0
Share/NCShareExtension+NCDelegate.swift

@@ -76,6 +76,10 @@ extension NCShareExtension: NCEmptyDataSetDelegate, NCAccountRequestDelegate {
         }
         self.activeAccount = activeAccount
 
+        // COLORS
+        NCBrandColor.shared.settingThemingColor(account: activeAccount.account)
+        NCBrandColor.shared.createUserColors()
+
         // NETWORKING
         NCCommunicationCommon.shared.setup(
             account: activeAccount.account,

+ 5 - 1
Share/NCShareExtension.swift

@@ -127,7 +127,11 @@ class NCShareExtension: UIViewController {
         }
 
         // Colors
-        NCBrandColor.shared.createImagesThemingColor()
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
+            NCBrandColor.shared.settingThemingColor(account: activeAccount.account)
+        } else {
+            NCBrandColor.shared.createImagesThemingColor()
+        }
         NCBrandColor.shared.createUserColors()
 
         hud.indicatorView = JGProgressHUDRingIndicatorView()

+ 2 - 2
iOSClient/Brand/NCBrand.swift

@@ -411,7 +411,6 @@ class NCBrandColor: NSObject {
         cacheImages.iconPages = UIImage(named: "icon-pages")!.image(color: brandElement, size: folderWidth)
     }
 
-    #if !EXTENSION
     func settingThemingColor(account: String) {
 
         let darker: CGFloat = 30    // %
@@ -490,9 +489,10 @@ class NCBrandColor: NSObject {
         }
         
         createImagesThemingColor()
+        #if !EXTENSION
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeTheming)
+        #endif
     }
-    #endif
 
     private func stepCalc(steps: Int, color1: CGColor, color2: CGColor) -> [CGFloat] {
         var step = [CGFloat](repeating: 0, count: 3)