mirror of
https://github.com/hub-team/OnlineChatSdk-SwiftPM.git
synced 2026-04-14 16:53:52 +00:00
0.2.3
This commit is contained in:
@@ -217,7 +217,6 @@ open class ChatController: UIViewController, WKNavigationDelegate, WKScriptMessa
|
|||||||
public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: any Error) {
|
public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: any Error) {
|
||||||
hideLoadingDialog()
|
hideLoadingDialog()
|
||||||
showMessage(error.localizedDescription)
|
showMessage(error.localizedDescription)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private func showMessage(_ message: String) {
|
private func showMessage(_ message: String) {
|
||||||
@@ -244,9 +243,6 @@ open class ChatController: UIViewController, WKNavigationDelegate, WKScriptMessa
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> ()) {
|
public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> ()) {
|
||||||
// print("widgetUrl = \(self.widgetUrl)")
|
|
||||||
// print("widgetOrg = \(self.widgetOrg)")
|
|
||||||
// print("absoluteString = \(navigationAction.request.url?.absoluteString)")
|
|
||||||
if let _ = navigationAction.request.url?.host {
|
if let _ = navigationAction.request.url?.host {
|
||||||
if (navigationAction.request.url?.absoluteString.contains(self.widgetOrg))! {
|
if (navigationAction.request.url?.absoluteString.contains(self.widgetOrg))! {
|
||||||
decisionHandler(.allow)
|
decisionHandler(.allow)
|
||||||
@@ -528,18 +524,17 @@ open class ChatController: UIViewController, WKNavigationDelegate, WKScriptMessa
|
|||||||
if chatView == nil {
|
if chatView == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
chatView.stopLoading()
|
||||||
|
callJsDestroy()
|
||||||
|
chatView = nil
|
||||||
|
|
||||||
dismiss(animated: true, completion: nil)
|
dismiss(animated: true, completion: nil)
|
||||||
navigationController?.popViewController(animated: true)
|
navigationController?.popViewController(animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func viewDidDisappear(_ animated: Bool) {
|
open override func viewDidDisappear(_ animated: Bool) {
|
||||||
super.viewDidDisappear(animated)
|
super.viewDidDisappear(animated)
|
||||||
|
onCloseSupport()
|
||||||
if animated && chatView != nil {
|
|
||||||
chatView.stopLoading()
|
|
||||||
callJsDestroy()
|
|
||||||
chatView = nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open func onLinkPressed(url: URL) {
|
open func onLinkPressed(url: URL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user