Manos Chorianopoulos

refresh campaigns after redeemCouponSet

......@@ -44,6 +44,12 @@ import SwiftEventBus
self.tableView.reloadData()
}
SwiftEventBus.onMainThread(self, name: "campaigns_retrieved") { result in
print("===== SwiftEventBus campaigns_retrieved =====")
self.campaigns = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
self.tableView.reloadData()
}
tableView.clipsToBounds = true
tableView.layer.cornerRadius = 30
tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
......
......@@ -33,6 +33,12 @@ import SwiftEventBus
self.tableView.reloadData()
}
SwiftEventBus.onMainThread(self, name: "campaigns_retrieved") { result in
print("===== SwiftEventBus campaigns_retrieved =====")
self.campaigns = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
self.tableView.reloadData()
}
tableView.clipsToBounds = true
tableView.layer.cornerRadius = 30
tableView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
......
......@@ -795,6 +795,8 @@ public class swiftApi {
swiftApi().setUniqueCampaignList(campaignsArray)
SwiftEventBus.post("campaigns_retrieved")
let filteredCampaigns = campaignsArray.filter {
let tempCampaign = $0
let isCcmsOffer = (tempCampaign.ccms_offer != nil) && (tempCampaign.ccms_offer != "") && (tempCampaign.ccms_offer == "true")
......