Implement checks for badge redemption progress for subscriptions.

This commit is contained in:
Alex Hart
2021-11-15 13:47:51 -04:00
committed by GitHub
parent 16ae2c870f
commit b0f43535c6
12 changed files with 166 additions and 16 deletions

View File

@@ -30,6 +30,7 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
private const val KEY_LEVEL_OPERATION_PREFIX = "donation.level.operation."
private const val KEY_LEVEL_HISTORY = "donation.level.history"
private const val DISPLAY_BADGES_ON_PROFILE = "donation.display.badges.on.profile"
private const val SUBSCRIPTION_REDEMPTION_FAILED = "donation.subscription.redemption.failed"
}
override fun onFirstEverAppLaunch() = Unit
@@ -197,4 +198,16 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
fun getDisplayBadgesOnProfile(): Boolean {
return getBoolean(DISPLAY_BADGES_ON_PROFILE, false)
}
fun getSubscriptionRedemptionFailed(): Boolean {
return getBoolean(SUBSCRIPTION_REDEMPTION_FAILED, false)
}
fun markSubscriptionRedemptionFailed() {
putBoolean(SUBSCRIPTION_REDEMPTION_FAILED, true)
}
fun clearSubscriptionRedemptionFailed() {
putBoolean(SUBSCRIPTION_REDEMPTION_FAILED, false)
}
}