aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
index 4abdd15f..f12ca7aa 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt
@@ -322,7 +322,9 @@ class ImageActivity : KauBaseActivity() {
val body = response.body ?: throw IOException("Failed to retrieve image body")
val tempFile = File(cacheDir(this@ImageActivity), "$imageHash.$imgExtension")
- tempFile.copyFromInputStream(body.byteStream())
+ if (!tempFile.exists() || tempFile.length() == 0L) {
+ tempFile.copyFromInputStream(body.byteStream())
+ }
tempFile
}