Manos Chorianopoulos

fix MarketPassViewController mapButtonAction

...@@ -191,10 +191,7 @@ import AVFoundation ...@@ -191,10 +191,7 @@ import AVFoundation
191 191
192 // MARK: - Actions 192 // MARK: - Actions
193 @IBAction func mapButtonAction(_ sender: Any) { 193 @IBAction func mapButtonAction(_ sender: Any) {
194 - let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self)) 194 + swiftApi().openSupermarketMap(self)
195 - let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
196 - vc.campaignUrl = swiftApi().getMarketPassMapUrl()
197 - self.navigationController?.pushViewController(vc, animated: true)
198 } 195 }
199 196
200 } 197 }
......
...@@ -9366,4 +9366,22 @@ public class swiftApi { ...@@ -9366,4 +9366,22 @@ public class swiftApi {
9366 } 9366 }
9367 } 9367 }
9368 9368
9369 + public func openSupermarketMap(_ controller: UIViewController) -> Void {
9370 + let status = swiftApi().getNetworkStatus()
9371 + if (status == -1 || status == 0) {
9372 + swiftApi().showDialog(controller, "Δεν υπάρχει σύνδεση","Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.")
9373 +
9374 + } else {
9375 + let tempCampaign = CampaignItemModel()
9376 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
9377 + let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
9378 + let url = swiftApi().getMarketPassMapUrl()
9379 + let params = swiftApi().constructCampaignParams(tempCampaign)
9380 + vc.campaignUrl = url
9381 + vc.params = params
9382 + vc.showHeader = false
9383 + controller.navigationController?.pushViewController(vc, animated: true)
9384 + }
9385 + }
9386 +
9369 } 9387 }
......