Manos Chorianopoulos

fix supermarket coupon sharing popup text

......@@ -3392,7 +3392,8 @@ public class swiftApi {
DispatchQueue.main.async {
if (sharingData?._status_outer == 1) {
if (sharingData?._status != nil && sharingData?._status != "" && sharingData?._status == "pending") {
self.initialSharingDialog(controller, "Συγχαρητήρια!", sharingData?._modal_text ?? "", sharingId)
let couponsetType = sharingData?._couponset_type ?? ""
self.initialSharingDialog(controller, "Συγχαρητήρια!", sharingData?._modal_text ?? "", sharingId, couponsetType)
} else if (sharingData?._status != nil && sharingData?._status != "" && sharingData?._status == "reject") {
self.returnSharingDialog(controller, sharingData?._modal_text ?? "")
......@@ -3414,7 +3415,7 @@ public class swiftApi {
}
}
func initialSharingDialog(_ controller: UIViewController, _ alertHeaderTitle: String, _ alertTitle: String, _ sharingId: String) -> Void {
func initialSharingDialog(_ controller: UIViewController, _ alertHeaderTitle: String, _ alertTitle: String, _ sharingId: String, _ couponsetType: String) -> Void {
let alert = UIAlertController(title: alertHeaderTitle, message: alertTitle, preferredStyle: .alert)
......@@ -3458,7 +3459,7 @@ public class swiftApi {
DispatchQueue.main.async {
if (sharingData?.getStatus == 1) {
self.acceptSharingDialog(controller)
self.acceptSharingDialog(controller, couponsetType)
swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in })
......@@ -3549,9 +3550,16 @@ public class swiftApi {
}
}
func acceptSharingDialog(_ controller: UIViewController) -> Void {
func acceptSharingDialog(_ controller: UIViewController, _ couponsetType: String) -> Void {
let alert = UIAlertController(title: "Συγχαρητήρια!", message: "Το δώρο σου ενεργοποιήθηκε επιτυχώς στο My Rewards!", preferredStyle: .alert)
var alertMessage = ""
if (couponsetType != "" && couponsetType == "supermarket") {
alertMessage = "Το δώρο σου ενεργοποιήθηκε επιτυχώς στο καλάθι του SuperMarket Deals!"
} else {
alertMessage = "Το δώρο σου ενεργοποιήθηκε επιτυχώς στο My Rewards!"
}
let alert = UIAlertController(title: "Συγχαρητήρια!", message: alertMessage, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
switch action.style{
case .default:
......@@ -4931,12 +4939,14 @@ public class swiftApi {
private var status: String
private var status_outer: Int
private var msg: String
private var couponset_type: String
init() {
self.modal_text = ""
self.status = ""
self.status_outer = -1
self.msg = ""
self.couponset_type = ""
}
init(dictionary: [String: Any]) {
......@@ -4946,6 +4956,7 @@ public class swiftApi {
self.status_outer = dictionary["status"] as? Int ?? -1
self.msg = dictionary["msg"] as? String ?? ""
self.couponset_type = dictionary["couponset_type"] as? String ?? ""
}
public var _modal_text: String {
......@@ -4983,6 +4994,15 @@ public class swiftApi {
self.msg = newValue
}
}
public var _couponset_type: String {
get { // getter
return self.couponset_type
}
set(newValue) { //setter
self.couponset_type = newValue
}
}
}
......