Browse Source

clear code

marinofaggiana 5 years ago
parent
commit
6634c936cc

+ 3 - 6
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -58,13 +58,10 @@ extension NCDetailNavigationController {
                     
                     alertController.addAction(UIAlertAction(title: NSLocalizedString("_yes_delete_", comment: ""), style: .default) { (action:UIAlertAction) in
                         
-                        if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
+                        NCMainCommon.sharedInstance.deleteFile(metadatas: [metadata], e2ee: false, serverUrl: "", folderocId: "") { (errorCode, errorMessage) in
                             
-                            NCMainCommon.sharedInstance.deleteFile(metadatas: [metadata], e2ee: directory.e2eEncrypted, serverUrl: metadata.serverUrl, folderocId: directory.ocId) { (errorCode, errorMessage) in
-                                
-                                if errorCode == 0 {
-                                    NCMainCommon.sharedInstance.reloadDatasource(ServerUrl: metadata.serverUrl, ocId: metadata.ocId, action: k_action_DEL)
-                                }
+                            if errorCode == 0 {
+                                NCMainCommon.sharedInstance.reloadDatasource(ServerUrl: metadata.serverUrl, ocId: metadata.ocId, action: k_action_DEL)
                             }
                         }
                     })

+ 0 - 12
iOSClient/Main/NCDetailViewController.swift

@@ -319,9 +319,6 @@ class NCDetailViewController: UIViewController {
                                 let frame = CGRect(x: 0, y: 0, width: self.backgroundView.frame.width, height: self.backgroundView.frame.height)
                                 let nextcloudText = NCViewerNextcloudText.init(frame: frame, configuration: WKWebViewConfiguration())
                                 nextcloudText.viewerAt(url!, metadata: metadata, editor: editor, view: self.backgroundView, viewController: self)
-                                if editor == k_editor_text && self.splitViewController!.isCollapsed {
-                                    self.navigationController?.navigationItem.hidesBackButton = true
-                                }
                                 
                             } else if errorCode != 0 {
                                 
@@ -339,9 +336,6 @@ class NCDetailViewController: UIViewController {
                         let frame = CGRect(x: 0, y: 0, width: self.backgroundView.frame.width, height: self.backgroundView.frame.height)
                         let nextcloudText = NCViewerNextcloudText.init(frame: frame, configuration: WKWebViewConfiguration())
                         nextcloudText.viewerAt(metadata.url, metadata: metadata, editor: editor, view: backgroundView, viewController: self)
-                        if editor == k_editor_text && self.splitViewController!.isCollapsed {
-                            self.navigationController?.navigationItem.hidesBackButton = true
-                        }
                     }
                 }
                 
@@ -362,9 +356,6 @@ class NCDetailViewController: UIViewController {
                             let frame = CGRect(x: 0, y: 0, width: self.backgroundView.frame.width, height: self.backgroundView.frame.height)
                             let richDocument = NCViewerRichdocument.init(frame: frame, configuration: WKWebViewConfiguration())
                             richDocument.viewRichDocumentAt(url!, metadata: metadata, view: self.backgroundView, viewController: self)
-                            if self.splitViewController != nil && self.splitViewController!.isCollapsed {
-                                self.navigationController?.navigationItem.hidesBackButton = true
-                            }
                             
                         } else if errorCode != 0 {
                             
@@ -381,9 +372,6 @@ class NCDetailViewController: UIViewController {
                     
                     let richDocument = NCViewerRichdocument.init(frame: backgroundView.frame, configuration: WKWebViewConfiguration())
                     richDocument.viewRichDocumentAt(metadata.url, metadata: metadata, view: backgroundView, viewController: self)
-                    if self.splitViewController != nil && self.splitViewController!.isCollapsed {
-                        self.navigationController?.navigationItem.hidesBackButton = true
-                    }
                 }
             }
         }