Remove blocking get from donation jobs.

This commit is contained in:
Alex Hart
2022-07-28 15:54:49 -03:00
committed by Greyson Parrelli
parent 8f12b2041a
commit f50bf3e9c2
17 changed files with 214 additions and 183 deletions

View File

@@ -47,7 +47,7 @@ data class GiftBadgeModel(val giftBadge: GiftBadge) : Key {
override fun loadData(priority: Priority, callback: DataFetcher.DataCallback<in InputStream>) {
try {
val receiptCredentialPresentation = ReceiptCredentialPresentation(giftBadge.giftBadge.redemptionToken.toByteArray())
val giftBadgeResponse = ApplicationDependencies.getDonationsService().getGiftBadge(Locale.getDefault(), receiptCredentialPresentation.receiptLevel).blockingGet()
val giftBadgeResponse = ApplicationDependencies.getDonationsService().getGiftBadge(Locale.getDefault(), receiptCredentialPresentation.receiptLevel)
if (giftBadgeResponse.result.isPresent) {
val badge = Badges.fromServiceBadge(giftBadgeResponse.result.get())
okHttpStreamFetcher = OkHttpStreamFetcher(client, GlideUrl(badge.imageUrl.toString()))