marinofaggiana 4 years ago
parent
commit
b8ed67c16e
1 changed files with 9 additions and 11 deletions
  1. 9 11
      iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

+ 9 - 11
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -56,17 +56,15 @@ import MarkdownKit
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
-        DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
-            NCNetworking.shared.readFile(serverUrlFileName: self.serverUrl, account: self.appDelegate.account) { (account, metadata, errorCode, errorDescription) in
-                
-                if errorCode == 0 && account == self.appDelegate.account {
-                    guard let metadata = metadata else { return }
-                    NCManageDatabase.sharedInstance.setDirectory(richWorkspace: metadata.richWorkspace, serverUrl: self.serverUrl, account: account)
-                    if self.richWorkspaceText != metadata.richWorkspace && metadata.richWorkspace != nil {
-                        self.appDelegate.activeFiles.richWorkspaceText = self.richWorkspaceText
-                        self.richWorkspaceText = metadata.richWorkspace!
-                        self.textView.attributedText = self.markdownParser.parse(metadata.richWorkspace!)
-                    }
+        NCNetworking.shared.readFile(serverUrlFileName: serverUrl, account: appDelegate.account) { (account, metadata, errorCode, errorDescription) in
+            
+            if errorCode == 0 && account == self.appDelegate.account {
+                guard let metadata = metadata else { return }
+                NCManageDatabase.sharedInstance.setDirectory(richWorkspace: metadata.richWorkspace, serverUrl: self.serverUrl, account: account)
+                if self.richWorkspaceText != metadata.richWorkspace && metadata.richWorkspace != nil {
+                    self.appDelegate.activeFiles.richWorkspaceText = self.richWorkspaceText
+                    self.richWorkspaceText = metadata.richWorkspace!
+                    self.textView.attributedText = self.markdownParser.parse(metadata.richWorkspace!)
                 }
             }
         }