소스 검색

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 년 전
부모
커밋
9355779f32
2개의 변경된 파일8개의 추가작업 그리고 9개의 파일을 삭제
  1. 6 7
      iOSClient/Settings/NCManageE2EE.swift
  2. 2 2
      iOSClient/Settings/NCSettings.m

+ 6 - 7
iOSClient/Settings/NCManageE2EE.swift

@@ -28,7 +28,7 @@ import LocalAuthentication
 
 @objc class NCManageE2EEInterface: NSObject {
     @objc func makeShipDetailsUI(account: String) -> UIViewController {
-        let details = NCViewE2EE(isEndToEndEnabled: CCUtility.isEnd(toEndEnabled: account))
+        let details = NCViewE2EE()
         return UIHostingController(rootView: details)
     }
 }
@@ -119,8 +119,7 @@ class NCManageE2EE: NSObject, NCEndToEndInitializeDelegate, TOPasscodeViewContro
 
 struct NCViewE2EE: View {
 
-    let manageE2EE = NCManageE2EE()
-    @State var isEndToEndEnabled: Bool = false
+    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
 
     var body: some View {
         VStack {
@@ -143,13 +142,13 @@ struct NCViewE2EE: View {
                 .cornerRadius(.infinity)
                 .frame(height: 100)
 
-                if isEndToEndEnabled {
+                if CCUtility.isEnd(toEndEnabled: appDelegate.account) {
                     Text("Activated")
                 } else {
                     Button(action: {
-                        manageE2EE.endToEndInitialize.initEndToEndEncryption()
+                        //manageE2EE.endToEndInitialize.initEndToEndEncryption()
                     }, label: {
-                        Text("Start")
+                        Text("Start E2EE")
                     })
                 }
 
@@ -158,7 +157,7 @@ struct NCViewE2EE: View {
                     if CCUtility.getPasscode().isEmpty {
                         NCContentPresenter.shared.showInfo(error: NKError(errorCode: 0, errorDescription: "_e2e_settings_lock_not_active_"))
                     } else {
-                        manageE2EE.requestPasscodeType("removeLocallyEncryption")
+                        //manageE2EE.requestPasscodeType("removeLocallyEncryption")
                     }
                 }, label: {
                     Text(NSLocalizedString("_e2e_settings_remove_", comment: ""))

+ 2 - 2
iOSClient/Settings/NCSettings.m

@@ -134,8 +134,8 @@
         [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
         [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"lock"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
-        //row.action.formSelector = @selector(manageE2EE:);
-        row.action.viewControllerClass = [NCManageEndToEndEncryption class];
+        row.action.formSelector = @selector(manageE2EE:);
+        //row.action.viewControllerClass = [NCManageEndToEndEncryption class];
         [section addFormRow:row];
     }