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

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 жил өмнө
parent
commit
d379322b08

+ 12 - 13
iOSClient/Settings/NCManageE2EE.swift

@@ -42,15 +42,23 @@ class NCManageE2EE: NSObject, ObservableObject, NCEndToEndInitializeDelegate, TO
     var passcodeType = ""
 
     @Published var isEndToEndEnabled: Bool = false
-    @Published var statusOfService: NKError?
+    @Published var statusOfService: String = NSLocalizedString("_status_in_progress_", comment: "")
 
     override init() {
         super.init()
 
         endToEndInitialize.delegate = self
         isEndToEndEnabled = CCUtility.isEnd(toEndEnabled: appDelegate.account)
-        endToEndInitialize.statusOfService { error in
-            self.statusOfService = error
+        if isEndToEndEnabled {
+            statusOfService = NSLocalizedString("_status_e2ee_configured_", comment: "")
+        } else {
+            endToEndInitialize.statusOfService { error in
+                if error == .success {
+                    self.statusOfService = NSLocalizedString("_status_e2ee_on_server_", comment: "")
+                } else {
+                    self.statusOfService = NSLocalizedString("_status_e2ee_not_setup_", comment: "")
+                }
+            }
         }
     }
 
@@ -155,19 +163,11 @@ struct NCViewE2EE: View {
         VStack {
             VStack {
 
-                if manageE2EE.statusOfService == nil {
-                    Text(NSLocalizedString("_status_in_progress_", comment: ""))
-                } else if manageE2EE.statusOfService == .success {
-                    Text(NSLocalizedString("_status_e2ee_on_server_", comment: ""))
-                } else {
-                    Text(NSLocalizedString("_status_e2ee_not_setup_", comment: ""))
-                }
-
                 if manageE2EE.isEndToEndEnabled {
 
                     List {
 
-                        Section(footer:Text("End-to-End Encription " + versionE2EE)) {
+                        Section(header: Text(manageE2EE.statusOfService) ,footer:Text("End-to-End Encription " + versionE2EE)) {
                             Label {
                                 Text(NSLocalizedString("_e2e_settings_activated_", comment: ""))
                             } icon: {
@@ -213,7 +213,6 @@ struct NCViewE2EE: View {
                         DeleteCerificateSection()
                     #endif
                     }
-
                 } else {
 
 

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -906,6 +906,7 @@
 "_status_in_progress_"      = "Status reading in progress …";
 "_status_e2ee_on_server_"   = "The end-to-end encryption is already configured in the server but not yet enabled on this device";
 "_status_e2ee_not_setup_"   = "The end-to-end encryption is not yet configured on the server";
+"_status_e2ee_configured_"  = "The end-to-end encryption is correctly configured";
 "_change_upload_filename_"  = "Do you want to save the file with a different name ?";
 "_save_file_as_"            = "Save file as %@";
 "_password_ascii_"          = "The password cannot contain special characters";