Add support for manual cancellation proto field.

This commit is contained in:
Alex Hart
2021-12-16 17:37:03 -04:00
committed by Greyson Parrelli
parent 5918227bff
commit 9177f5637a
6 changed files with 72 additions and 45 deletions

View File

@@ -200,6 +200,7 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
if (it.status == 200 || it.status == 204) {
Log.d(TAG, "Successfully set user subscription to level $subscriptionLevel with response code ${it.status}", true)
SignalStore.donationsValues().clearUserManuallyCancelled()
scheduleSyncForAccountRecordChange()
SignalStore.donationsValues().clearLevelOperations()
LevelUpdate.updateProcessingState(false)
Completable.complete()

View File

@@ -188,6 +188,7 @@ class SubscribeViewModel(
SignalStore.donationsValues().markUserManuallyCancelled()
refreshActiveSubscription()
MultiDeviceSubscriptionSyncRequestJob.enqueue()
donationPaymentRepository.scheduleSyncForAccountRecordChange()
store.update { it.copy(stage = SubscribeState.Stage.READY) }
},
onError = { throwable ->