Sfoglia il codice sorgente

in the more menu now it shows the displayName instead of the userName if exists

Marco Espinal 8 anni fa
parent
commit
df2f03a15e
1 ha cambiato i file con 12 aggiunte e 1 eliminazioni
  1. 12 1
      iOSClient/Main/CCMore.swift

+ 12 - 1
iOSClient/Main/CCMore.swift

@@ -122,7 +122,18 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         tableAccont = CCCoreData.getActiveAccount()
         if (tableAccont != nil) {
         
-            labelUsername.text = self.tableAccont?.user
+            if let displayName = self.tableAccont!.displayName {
+                if displayName.isEmpty {
+                    labelUsername.text = self.tableAccont!.user
+                }
+                else{
+                    labelUsername.text = self.tableAccont!.displayName
+                }
+            }
+            else{
+                labelUsername.text = self.tableAccont!.user
+            }
+            
             progressQuota.progress = Float((self.tableAccont?.quotaRelative)!) / 100
         
             let quota : String = CCUtility.transformedSize(Double((self.tableAccont?.quotaTotal)!))