aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
index b5521e3e..150d29f4 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt
@@ -91,13 +91,16 @@ class LoginActivity : BaseActivity() {
val cookie = web.loadLogin { refresh(it != 100) }
L.d { "Login found" }
FbCookie.save(cookie.id)
- web.fadeOut(onFinish = {
- profile.fadeIn()
- this@LoginActivity.launch { loadInfo(cookie) }
- })
+ webFadeOut()
+ profile.fadeIn()
+ loadInfo(cookie)
}
}
+ private suspend fun webFadeOut(): Unit = suspendCancellableCoroutine { cont ->
+ web.fadeOut { cont.resume(Unit) }
+ }
+
private fun refresh(refreshing: Boolean) {
refreshChannel.offer(refreshing)
}