1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-09 20:42:34 +01:00

Remove laziness in blankResource

This commit is contained in:
Allan Wang 2021-09-28 23:06:34 -07:00
parent 355d8ae268
commit 749ebe31d0
No known key found for this signature in database
GPG Key ID: 69D90B885D405BDB
2 changed files with 2 additions and 2 deletions

View File

@ -175,6 +175,7 @@ abstract class FrostContentViewBase(
} }
refreshChannel.subscribeDuringJob(scope, ContextHelper.coroutineContext) { r -> refreshChannel.subscribeDuringJob(scope, ContextHelper.coroutineContext) { r ->
L.v { "Refreshing $r" }
refresh.isRefreshing = r refresh.isRefreshing = r
} }

View File

@ -30,13 +30,12 @@ import java.io.ByteArrayInputStream
* Handler to decide when a request should be done by us * Handler to decide when a request should be done by us
* This is the crux of Frost's optimizations for the web browser * This is the crux of Frost's optimizations for the web browser
*/ */
private val blankResource: WebResourceResponse by lazy { private val blankResource: WebResourceResponse =
WebResourceResponse( WebResourceResponse(
"text/plain", "text/plain",
"utf-8", "utf-8",
ByteArrayInputStream("".toByteArray()) ByteArrayInputStream("".toByteArray())
) )
}
fun WebView.shouldFrostInterceptRequest(request: WebResourceRequest): WebResourceResponse? { fun WebView.shouldFrostInterceptRequest(request: WebResourceRequest): WebResourceResponse? {
val requestUrl = request.url?.toString() ?: return null val requestUrl = request.url?.toString() ?: return null