Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[IP-578] Subscription screen updating with promo results
Loading branch information
@@ -302,7 +302,7 @@ extension SubscriptionController: SubscriptionDataSourceDelegate {
completion (self .standardSubscriptionProducts )
completion (self .standardSubscriptionProducts )
} else {
} else {
self .requestProducts { (standart, promo) in
self .requestProducts { (standart, promo) in
completion (promo )
completion (standart )
}
}
}
}
}
}
@@ -98,14 +98,20 @@ class PromoUpgradeViewController: UIViewController {
self .startLoadingAnimation ()
self .startLoadingAnimation ()
self .dataSource .fetchProducts { (success) in
self .dataSource .fetchProducts { (success) in
if success {
if success {
self .subscriptionsTableView . reloadData ()
self .reloadData ()
} else {
} else {
self .showProductsRetrievalFailedAlert ()
self .showProductsRetrievalFailedAlert ()
}
}
self .stopLoadingAnimation ()
self .stopLoadingAnimation ()
}
}
}
}
private func reloadData () {
self .subscriptionsTableView .reloadData ()
self .conditionsLabel .text = self .dataSource .getConditionText ()
self .promoCodeLabel .text = self .dataSource .promoText ()
}
private func showProductsRetrievalFailedAlert () {
private func showProductsRetrievalFailedAlert () {
let errorDescirption = NSLocalizedString (" Sorry, Lumen cannot connect to the Internet." , tableName : " Lumen" , comment : " Error when can't get list of available subscriptions" )
let errorDescirption = NSLocalizedString (" Sorry, Lumen cannot connect to the Internet." , tableName : " Lumen" , comment : " Error when can't get list of available subscriptions" )
let alertController = UIAlertController (title : " " , message : errorDescirption, preferredStyle : .alert )
let alertController = UIAlertController (title : " " , message : errorDescirption, preferredStyle : .alert )
@@ -142,7 +148,7 @@ class PromoUpgradeViewController: UIViewController {
self .view .addSubview (subscriptionsTableView)
self .view .addSubview (subscriptionsTableView)
conditionsLabel.numberOfLines = 0
conditionsLabel.numberOfLines = 0
conditionsLabel.text = self .dataSource .getConditionText () // NSLocalizedString("", tableName: "Lumen", comment: "[Upgrade Flow] Conditions text")
conditionsLabel.text = self .dataSource .getConditionText ()
conditionsLabel.textColor = UIColor (colorString : " BDC0CE" )
conditionsLabel.textColor = UIColor (colorString : " BDC0CE" )
conditionsLabel.textAlignment = .center
conditionsLabel.textAlignment = .center
Toggle all file notes
Toggle all file annotations