marinofaggiana 3 yıl önce
ebeveyn
işleme
e716946472
1 değiştirilmiş dosya ile 32 ekleme ve 31 silme
  1. 32 31
      iOSClient/UserStatus/NCUserStatus.swift

+ 32 - 31
iOSClient/UserStatus/NCUserStatus.swift

@@ -373,7 +373,6 @@ class NCUserStatus: UIViewController {
                         }
                         
                         self.tableView.reloadData()
-                        
                     }
                     
                     self.dismissIfError(errorCode, errorDescription: errorDescription)
@@ -384,6 +383,38 @@ class NCUserStatus: UIViewController {
             self.dismissIfError(errorCode, errorDescription: errorDescription)
         }
     }
+    
+    // MARK: - Algorithms
+
+    func getPredefinedClearStatusText(clearAt: NSDate?, clearAtTime: String?, clearAtType: String?) -> String {
+             
+        // Date
+        if clearAt != nil {
+            
+            return CCUtility.getTitleSectionDate(clearAt! as Date)
+        }
+        
+        // Period
+        if clearAtTime != nil && clearAtType == "period" {
+            
+            switch clearAtTime {
+            case "3600":
+                return NSLocalizedString("_an_hour_", comment: "")
+            case "1800":
+                return NSLocalizedString("_30_minutes_", comment: "")
+            default:
+                return NSLocalizedString("_dont_clear_", comment: "")
+            }
+        }
+        
+        // End of
+        if clearAtTime != nil && clearAtType == "end-of" {
+            
+            return NSLocalizedString(clearAtTime!, comment: "")
+        }
+        
+        return NSLocalizedString("_dont_clear_", comment: "")
+    }
 }
 
 @available(iOS 13.0, *)
@@ -516,34 +547,4 @@ extension NCUserStatus: UITableViewDataSource {
     
         return cell
     }
-    
-    func getPredefinedClearStatusText(clearAt: NSDate?, clearAtTime: String?, clearAtType: String?) -> String {
-             
-        // Date
-        if clearAt != nil {
-            
-            return CCUtility.getTitleSectionDate(clearAt! as Date)
-        }
-        
-        // Period
-        if clearAtTime != nil && clearAtType == "period" {
-            
-            switch clearAtTime {
-            case "3600":
-                return NSLocalizedString("_an_hour_", comment: "")
-            case "1800":
-                return NSLocalizedString("_30_minutes_", comment: "")
-            default:
-                return NSLocalizedString("_dont_clear_", comment: "")
-            }
-        }
-        
-        // End of
-        if clearAtTime != nil && clearAtType == "end-of" {
-            
-            return NSLocalizedString(clearAtTime!, comment: "")
-        }
-        
-        return NSLocalizedString("_dont_clear_", comment: "")
-    }
 }