Manos Chorianopoulos

fix MyRewards to show coupon tiles always

......@@ -1078,18 +1078,20 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
// }
if (section == 0) {
let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0 || sumRedeemed > 0.0) {
// TODO: Uncomment if we want to hide empty tiles again
// let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
// if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0 || sumRedeemed > 0.0) {
return 1
} else {
return 0
}
// } else {
// return 0
// }
} else if (section == 1) {
if (self.showEmptyView == true) {
return 1
} else {
// TODO: Uncomment if we want to show emptyView again
// if (self.showEmptyView == true) {
// return 1
// } else {
return 0
}
// }
} else if (section == 2) {
return 1
}
......@@ -1150,18 +1152,20 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
// }
if (indexPath.section == 0) {
let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0 || sumRedeemed > 0.0) {
// TODO: Uncomment if we want to hide empty tiles again
// let sumRedeemed = totalCouponValue + totalCouponDiscount + unifiedCouponsDiscount
// if (self.dfyCoupons.count > 0 || self.unifiedCoupons.count > 0 || self.coupons.count > 0 || sumRedeemed > 0.0) {
return UITableView.automaticDimension
} else {
return 0.0
}
// } else {
// return 0.0
// }
} else if (indexPath.section == 1) {
if (self.showEmptyView == true) {
return UITableView.automaticDimension
} else {
// TODO: Uncomment if we want to show emptyView again
// if (self.showEmptyView == true) {
// return UITableView.automaticDimension
// } else {
return 0.0
}
// }
} else if (indexPath.section == 2) {
return UITableView.automaticDimension
}
......