aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-02-29 23:34:58 -0800
committerGitHub <noreply@github.com>2020-02-29 23:34:58 -0800
commite732e30d97babca49ba5f7d97aea1620ba14024b (patch)
tree3101fb9e17eede3ffbf75e96358c6ac0a330aaf7 /app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt
parente893c5ab9a976031c15e792583b411f6c9a429e5 (diff)
parent551dbbcf1a56c33c378d6edfc3a3615311867001 (diff)
downloadfrost-e732e30d97babca49ba5f7d97aea1620ba14024b.tar.gz
frost-e732e30d97babca49ba5f7d97aea1620ba14024b.tar.bz2
frost-e732e30d97babca49ba5f7d97aea1620ba14024b.zip
Merge pull request #1657 from AllanWang/versions
Update versions
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt
index dd31d303..9ca622a3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt
@@ -28,6 +28,7 @@ import ca.allanwang.kau.utils.launchMain
import com.pitchedapps.frost.contracts.FrostContentContainer
import com.pitchedapps.frost.contracts.FrostContentCore
import com.pitchedapps.frost.contracts.FrostContentParent
+import com.pitchedapps.frost.db.CookieDao
import com.pitchedapps.frost.db.FrostDatabase
import com.pitchedapps.frost.db.currentCookie
import com.pitchedapps.frost.facebook.FB_HOME_URL
@@ -62,6 +63,7 @@ class FrostWebView @JvmOverloads constructor(
val fbCookie: FbCookie by inject()
val prefs: Prefs by inject()
+ val cookieDao: CookieDao by inject()
override fun reload(animate: Boolean) {
if (parent.registerTransition(false, animate))
@@ -92,10 +94,9 @@ class FrostWebView @JvmOverloads constructor(
webChromeClient = FrostChromeClient(this)
addJavascriptInterface(FrostJSI(this), "Frost")
setBackgroundColor(Color.TRANSPARENT)
- val db = FrostDatabase.get()
setDownloadListener { url, userAgent, contentDisposition, mimetype, contentLength ->
context.ctxCoroutine.launchMain {
- val cookie = db.cookieDao().currentCookie() ?: return@launchMain
+ val cookie = cookieDao.currentCookie(prefs) ?: return@launchMain
context.frostDownload(
cookie,
url,