mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-19 20:38:53 +01:00
#1405 - Fix upgrade restoration
This commit is contained in:
@@ -77,10 +77,13 @@ class BillingManager @Inject constructor(
|
|||||||
|
|
||||||
private fun queryPurchases() {
|
private fun queryPurchases() {
|
||||||
executeServiceRequest {
|
executeServiceRequest {
|
||||||
val purchasesResult = billingClient.queryPurchases(SkuType.INAPP)
|
// Load the cached data
|
||||||
|
purchaseListObservable.onNext(billingClient.queryPurchases(SkuType.INAPP).purchasesList.orEmpty())
|
||||||
|
|
||||||
// Handle purchase result
|
// On a fresh device, the purchase might not be cached, and so we'll need to force a refresh
|
||||||
purchaseListObservable.onNext(purchasesResult.purchasesList.orEmpty())
|
billingClient.queryPurchaseHistoryAsync(SkuType.INAPP) { _, _ ->
|
||||||
|
purchaseListObservable.onNext(billingClient.queryPurchases(SkuType.INAPP).purchasesList.orEmpty())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user