From 749ebe31d0d23d7097a7c989a8324714aa28d996 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 28 Sep 2021 23:06:34 -0700 Subject: Remove laziness in blankResource --- app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt | 1 + .../main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt index 124a75df..c30ee199 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt @@ -175,6 +175,7 @@ abstract class FrostContentViewBase( } refreshChannel.subscribeDuringJob(scope, ContextHelper.coroutineContext) { r -> + L.v { "Refreshing $r" } refresh.isRefreshing = r } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt index 5586d479..defdcae1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt @@ -30,13 +30,12 @@ import java.io.ByteArrayInputStream * Handler to decide when a request should be done by us * This is the crux of Frost's optimizations for the web browser */ -private val blankResource: WebResourceResponse by lazy { +private val blankResource: WebResourceResponse = WebResourceResponse( "text/plain", "utf-8", ByteArrayInputStream("".toByteArray()) ) -} fun WebView.shouldFrostInterceptRequest(request: WebResourceRequest): WebResourceResponse? { val requestUrl = request.url?.toString() ?: return null -- cgit v1.2.3