Simplify usage of BillingManager

This commit is contained in:
Moez Bhatti
2018-04-16 18:44:52 -04:00
parent 29c0885131
commit 38891c04bf
6 changed files with 22 additions and 40 deletions
@@ -78,8 +78,8 @@ class ThemePickerViewModel(intent: Intent) : QkViewModel<ThemePickerView, ThemeP
// Update the theme, when apply is clicked
view.hsvThemeAppliedIntent
.withLatestFrom(view.hsvThemeSelectedIntent, { _, color -> color })
.withLatestFrom(billingManager.plusStatus, { color, upgradeStatus ->
if (upgradeStatus == BillingManager.UpgradeStatus.REGULAR) {
.withLatestFrom(billingManager.upgradeStatus, { color, upgraded ->
if (!upgraded) {
view.showQksmsPlusSnackbar()
} else {
theme.set(color)