marinofaggiana 5 жил өмнө
parent
commit
3f817924d3

+ 0 - 2
iOSClient/Activity/NCActivity.swift

@@ -404,8 +404,6 @@ extension activityTableViewCell: UICollectionViewDelegate {
                     
                     
                     NCCommunication.sharedInstance.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", account: activityPreview.account) { (account, files, errorCode, errorDescription) in
                     NCCommunication.sharedInstance.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", account: activityPreview.account) { (account, files, errorCode, errorDescription) in
                        
                        
-                    //OCNetworking.sharedManager()?.readFile(withAccount: activityPreview.account, serverUrl: serverUrl, fileName: fileName, completion: { (account, metadata, message, errorCode) in
-                        
                         NCUtility.sharedInstance.stopActivityIndicator()
                         NCUtility.sharedInstance.stopActivityIndicator()
                         
                         
                         if account == self.appDelegate.activeAccount && errorCode == 0 && files?.count ?? 0 > 0  {
                         if account == self.appDelegate.activeAccount && errorCode == 0 && files?.count ?? 0 > 0  {

+ 7 - 6
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -59,12 +59,13 @@ import MarkdownKit
             
             
             if errorCode == 0 && account == self.appDelegate.activeAccount && files?.count ?? 0 > 0 {
             if errorCode == 0 && account == self.appDelegate.activeAccount && files?.count ?? 0 > 0 {
                 
                 
-                let metadata = NCNetworking.sharedInstance.convertFileToMetadata(files![0])
-                NCManageDatabase.sharedInstance.setDirectory(ocId: metadata.ocId, serverUrl: metadata.serverUrl, richWorkspace: metadata.richWorkspace, account: account)
-                if self.richWorkspaceText != metadata.richWorkspace {
-                    self.appDelegate.activeMain.richWorkspaceText = self.richWorkspaceText
-                    self.richWorkspaceText = metadata.richWorkspace
-                    self.textView.attributedText = self.markdownParser.parse(metadata.richWorkspace)
+                if let file = files?[0] {
+                    NCManageDatabase.sharedInstance.setDirectory(ocId: file.ocId, serverUrl: self.serverUrl, richWorkspace: file.richWorkspace, account: account)
+                    if self.richWorkspaceText != file.richWorkspace {
+                        self.appDelegate.activeMain.richWorkspaceText = self.richWorkspaceText
+                        self.richWorkspaceText = file.richWorkspace
+                        self.textView.attributedText = self.markdownParser.parse(file.richWorkspace)
+                    }
                 }
                 }
             }
             }
         }
         }