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.kt3
1 files changed, 2 insertions, 1 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 c8e551a3..449f0ab0 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
@@ -41,6 +41,7 @@ import kotlinx.coroutines.launch
*/
class FrostJSI(val web: FrostWebView) {
+ private val prefs: Prefs = web.prefs
private val context: Context = web.context
private val activity: MainActivity? = context as? MainActivity
private val header: SendChannel<String>? = activity?.headerBadgeChannel
@@ -57,7 +58,7 @@ class FrostJSI(val web: FrostWebView) {
@JavascriptInterface
fun loadVideo(url: String?, isGif: Boolean): Boolean =
- if (url != null && Prefs.enablePip) {
+ if (url != null && prefs.enablePip) {
web.post {
(context as? VideoViewHolder)?.showVideo(url, isGif)
?: L.e { "Could not load video; contract not implemented" }