Manos Chorianopoulos

fix webview to be presented at openSupermarketMap

......@@ -23,6 +23,7 @@ var timer2: DispatchSourceTimer?
public var campaignUrl: String = ""
public var params: String = ""
public var showHeader: Bool = false
public var isPresented: Bool = false
// Location Permissions
var webView: WKWebView!
......@@ -541,7 +542,11 @@ var timer2: DispatchSourceTimer?
if (eventArray[0] == "event") {
if (eventArray[1] == "closeArtwork") {
self.mWebviewSupermarket = false
self.navigationController?.popViewController(animated: true)
if (isPresented) {
self.dismiss(animated: true, completion: nil)
} else {
self.navigationController?.popViewController(animated: true)
}
} else if (eventArray[1] == "addUserTag") {
// SwiftEventBus.post("questionnaire", sender: questionnaireEvent)
......
......@@ -9401,7 +9401,15 @@ public class swiftApi {
vc.campaignUrl = url
vc.params = params
vc.showHeader = false
controller.navigationController?.pushViewController(vc, animated: true)
if (controller.navigationController != nil) {
vc.isPresented = false
controller.navigationController?.pushViewController(vc, animated: true)
} else {
vc.isPresented = true
vc.modalPresentationStyle = .fullScreen
controller.present(vc, animated: true, completion: nil)
}
}
}
......