mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Remove unnecessary subscriber call for manual cancel.
This commit is contained in:
committed by
Cody Henthorne
parent
6dcb2e8d24
commit
30b339a482
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user