|
@@ -23,6 +23,7 @@
|
|
|
|
|
|
import Foundation
|
|
|
import WebKit
|
|
|
+import NCCommunication
|
|
|
|
|
|
class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHandler, NCSelectDelegate {
|
|
|
|
|
@@ -144,8 +145,10 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
|
|
|
NCUtility.sharedInstance.startActivityIndicator(view: self, bottom: 0)
|
|
|
}
|
|
|
|
|
|
- _ = OCNetworking.sharedManager()?.download(withAccount: metadata.account, url: urlString, fileNameLocalPath: fileNameLocalPath, encode:false, completion: { (account, message, errorCode) in
|
|
|
-
|
|
|
+ _ = NCCommunication.shared.download(serverUrlFileName: urlString, fileNameLocalPath: fileNameLocalPath, customUserAgent: nil, addCustomHeaders: nil, account: appDelegate.activeAccount, progressHandler: { (progress) in
|
|
|
+
|
|
|
+ }, completionHandler: { (account, etag, date, lenght, errorCode, errorDescription) in
|
|
|
+
|
|
|
if errorCode == 0 && account == self.metadata.account {
|
|
|
if type == "print" {
|
|
|
NCUtility.sharedInstance.stopActivityIndicator()
|
|
@@ -165,8 +168,9 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
|
|
|
self.documentInteractionController.presentOptionsMenu(from: self.appDelegate.window.rootViewController!.view.bounds, in: self.appDelegate.window.rootViewController!.view, animated: true)
|
|
|
}
|
|
|
} else {
|
|
|
- NCContentPresenter.shared.messageNotification("_error_", description: message, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
+ NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
} else if param["MessageName"] as? String == "fileRename" {
|