Manos Chorianopoulos

fix gfy campaigns sorting

......@@ -13,9 +13,10 @@ import SwiftEventBus
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var tableView: UITableView!
public var campaigns:Array<swiftApi.CampaignItemModel> = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
public var campaigns:Array<swiftApi.CampaignItemModel> = []
public var seasonalList:Array<swiftApi.LoyaltyGiftsForYouPackage> = swiftApi().getSeasonalList()
public var ccmsList:Array<swiftApi.LoyaltyContextualOfferModel> = swiftApi().getCCMSLoyaltyCampaigns()
public var loyaltyList:Array<swiftApi.CampaignItemModel> = swiftApi().mergeGFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
public override func viewDidLoad() {
......@@ -44,6 +45,10 @@ import SwiftEventBus
}
}
}
if (loyaltyList.count > 0) {
campaigns = campaigns + loyaltyList
}
setBackButton()
setNavigationTitle("GIFTS for YOU", "bold")
......@@ -112,6 +117,10 @@ import SwiftEventBus
}
}
}
if (self.loyaltyList.count > 0) {
self.campaigns = self.campaigns + self.loyaltyList
}
self.tableView.reloadData()
}
......