Remove unnecessary subscriber call for manual cancel.
This commit is contained in:
parent
6dcb2e8d24
commit
30b339a482
2 changed files with 15 additions and 14 deletions
|
@ -298,8 +298,7 @@ object InAppPaymentsRepository {
|
|||
@JvmStatic
|
||||
@WorkerThread
|
||||
fun isUserManuallyCancelled(subscriberType: InAppPaymentSubscriberRecord.Type): Boolean {
|
||||
val subscriber = getSubscriber(subscriberType) ?: return false
|
||||
val latestSubscription = SignalDatabase.inAppPayments.getLatestInAppPaymentByType(subscriber.type.inAppPaymentType)
|
||||
val latestSubscription = SignalDatabase.inAppPayments.getLatestInAppPaymentByType(subscriberType.inAppPaymentType)
|
||||
|
||||
return if (latestSubscription == null) {
|
||||
SignalStore.donationsValues().isUserManuallyCancelled()
|
||||
|
|
|
@ -478,20 +478,22 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
|
|||
@WorkerThread
|
||||
fun updateLocalStateForLocalSubscribe(subscriberType: InAppPaymentSubscriberRecord.Type) {
|
||||
synchronized(subscriberType) {
|
||||
Log.d(TAG, "[updateLocalStateForLocalSubscribe] Clearing donation values.")
|
||||
if (subscriberType == InAppPaymentSubscriberRecord.Type.DONATION) {
|
||||
Log.d(TAG, "[updateLocalStateForLocalSubscribe] Clearing donation values.")
|
||||
|
||||
clearUserManuallyCancelled()
|
||||
clearLevelOperations()
|
||||
setUnexpectedSubscriptionCancelationChargeFailure(null)
|
||||
unexpectedSubscriptionCancelationReason = null
|
||||
unexpectedSubscriptionCancelationTimestamp = 0L
|
||||
refreshSubscriptionRequestCredential()
|
||||
clearSubscriptionReceiptCredential()
|
||||
clearUserManuallyCancelled()
|
||||
clearLevelOperations()
|
||||
setUnexpectedSubscriptionCancelationChargeFailure(null)
|
||||
unexpectedSubscriptionCancelationReason = null
|
||||
unexpectedSubscriptionCancelationTimestamp = 0L
|
||||
refreshSubscriptionRequestCredential()
|
||||
clearSubscriptionReceiptCredential()
|
||||
|
||||
val expiredBadge = getExpiredBadge()
|
||||
if (expiredBadge != null && expiredBadge.isSubscription()) {
|
||||
Log.d(TAG, "[updateLocalStateForLocalSubscribe] Clearing expired badge.")
|
||||
setExpiredBadge(null)
|
||||
val expiredBadge = getExpiredBadge()
|
||||
if (expiredBadge != null && expiredBadge.isSubscription()) {
|
||||
Log.d(TAG, "[updateLocalStateForLocalSubscribe] Clearing expired badge.")
|
||||
setExpiredBadge(null)
|
||||
}
|
||||
}
|
||||
|
||||
val subscriber = InAppPaymentsRepository.requireSubscriber(subscriberType)
|
||||
|
|
Loading…
Add table
Reference in a new issue