aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt b/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt
index 6bb50ccd..8215de03 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt
@@ -222,15 +222,16 @@ class OfflineWebsite(
}
}
- suspend fun loadAndZip(name: String, progress: (Int) -> Unit = {}): Boolean = withContext(Dispatchers.IO) {
- coroutineScope {
- val success = load { progress((it * 0.85f).toInt()) }
- if (!success) return@coroutineScope false
- val result = zip(name)
- progress(100)
- return@coroutineScope result
+ suspend fun loadAndZip(name: String, progress: (Int) -> Unit = {}): Boolean =
+ withContext(Dispatchers.IO) {
+ coroutineScope {
+ val success = load { progress((it * 0.85f).toInt()) }
+ if (!success) return@coroutineScope false
+ val result = zip(name)
+ progress(100)
+ return@coroutineScope result
+ }
}
- }
private fun downloadFile(url: String): Boolean {
return try {