diff options
author | Allan Wang <me@allanwang.ca> | 2021-11-22 22:24:17 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-11-22 22:24:17 -0800 |
commit | 1dd7be9174f1740aa1cae29f6d62d6f83f5917ba (patch) | |
tree | 5734afee77ddd8ea498df7065a1ec3de28a387f7 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | |
parent | eb2e0d07f278eb2079666ffabcbee007173c17af (diff) | |
download | frost-1dd7be9174f1740aa1cae29f6d62d6f83f5917ba.tar.gz frost-1dd7be9174f1740aa1cae29f6d62d6f83f5917ba.tar.bz2 frost-1dd7be9174f1740aa1cae29f6d62d6f83f5917ba.zip |
Migrate refresh channel to flow
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.kt | 8 |
1 files changed, 5 insertions, 3 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 3ead78f4..f43f3b81 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -39,17 +39,18 @@ import javax.inject.Inject /** * Created by Allan Wang on 2017-06-01. */ +@FrostWebScoped class FrostJSI @Inject internal constructor( val web: FrostWebView, private val activity: Activity, private val fbCookie: FbCookie, - private val prefs: Prefs + private val prefs: Prefs, + @FrostRefresh private val refreshEmit: FrostEmitter<Boolean> ) { private val mainActivity: MainActivity? = activity as? MainActivity private val webActivity: WebOverlayActivityBase? = activity as? WebOverlayActivityBase private val header: SendChannel<String>? = mainActivity?.headerBadgeChannel - private val refresh: SendChannel<Boolean> = web.parent.refreshChannel private val cookies: List<CookieEntity> = activity.cookies() /** @@ -144,7 +145,8 @@ class FrostJSI @Inject internal constructor( @JavascriptInterface fun isReady() { if (web.frostWebClient !is FrostWebViewClientMenu) { - refresh.offer(false) + L.v { "JSI is ready" } + refreshEmit(false) } } |