Skip to content

Commit

Permalink
Refactor IOSImageLoader#getImage
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Sep 23, 2023
1 parent cfeade2 commit 7988126
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,7 @@ class IOSImageLoader : ImageLoader {
NSCharacterSet.URLFragmentAllowedCharacterSet
)
?: return@withContext null
val cachedImage = loadCachedImage(encodedUrl)
val data =
if (cachedImage != null) {
cachedImage
} else {
downloadImage(encodedUrl) ?: return@withContext null
}
val data = loadCachedImage(encodedUrl) ?: downloadImage(encodedUrl) ?: return@withContext null

return@withContext Image.makeFromEncoded(data).toBitmap(size).asComposeImageBitmap()
}
Expand Down

0 comments on commit 7988126

Please sign in to comment.