diff --git a/app/src/main/java/com/keylesspalace/tusky/util/GlideExtensions.kt b/app/src/main/java/com/keylesspalace/tusky/util/GlideExtensions.kt index bc5ad2b3a..01629c731 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/GlideExtensions.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/GlideExtensions.kt @@ -13,8 +13,8 @@ import kotlinx.coroutines.suspendCancellableCoroutine * Allows waiting for a Glide request to complete without blocking a background thread. */ suspend fun RequestBuilder.submitAsync( - width: Int = Int.MIN_VALUE, - height: Int = Int.MIN_VALUE + width: Int = Target.SIZE_ORIGINAL, + height: Int = Target.SIZE_ORIGINAL ): R { return suspendCancellableCoroutine { continuation -> val target = addListener( @@ -36,7 +36,9 @@ suspend fun RequestBuilder.submitAsync( dataSource: DataSource, isFirstResource: Boolean ): Boolean { - continuation.resume(resource) + if (target?.request?.isComplete == true) { + continuation.resume(resource) + } return false } }