Manos Chorianopoulos

refresh campaigns after redeemCouponSet

......@@ -43,6 +43,12 @@ import SwiftEventBus
self.campaigns = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
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
......
......@@ -32,6 +32,12 @@ import SwiftEventBus
self.campaigns = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
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
......
......@@ -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")
......