aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
index 9264ea52..d735fd50 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
@@ -17,6 +17,7 @@ class FrostJSI(val web: FrostWebView) {
private val context = web.context
private val activity = context as? MainActivity
private val header: Subject<String>? = activity?.headerBadgeObservable
+ private val refresh: Subject<Boolean> = web.parent.refreshObservable
private val cookies = activity?.cookies() ?: arrayListOf()
/**
@@ -89,6 +90,11 @@ class FrostJSI(val web: FrostWebView) {
}
@JavascriptInterface
+ fun isReady() {
+ refresh.onNext(false)
+ }
+
+ @JavascriptInterface
fun handleHtml(html: String?) {
html ?: return
web.post { web.frostWebClient.handleHtml(html) }