This commit is contained in:
zaednasr 2024-11-07 19:38:50 +01:00
parent db2d0cb981
commit 0c00ab350d
No known key found for this signature in database
GPG key ID: 92B1DE23AD3D0E9E
2 changed files with 3 additions and 4 deletions

View file

@ -55,6 +55,7 @@ class WebViewActivity : BaseActivity() {
generateBtn = toolbar.findViewById(R.id.generate)
webViewCompose = findViewById(R.id.webview_compose)
cookieManager = CookieManager.getInstance()
preferences = PreferenceManager.getDefaultSharedPreferences(this@WebViewActivity)
webViewClient = object : AccompanistWebViewClient() {
@ -62,13 +63,11 @@ class WebViewActivity : BaseActivity() {
super.onPageFinished(view, url)
kotlin.runCatching {
toolbar.title = view?.title ?: ""
cookies = CookieManager.getInstance().getCookie(view?.url)
cookies = cookieManager.getCookie(view?.url)
}
}
}
cookieManager = CookieManager.getInstance()
toolbar.setNavigationOnClickListener {
cookieManager.flush()
onBackPressedDispatcher.onBackPressed()

View file

@ -220,7 +220,7 @@ object Extensions {
runCatching {
val tmp = this.getString(it)
if (tmp != "null") {
return if (tmp.startsWith("[")) {
return if (tmp.startsWith("[") && tmp.endsWith("]")) {
Json.decodeFromString<List<String>>(tmp).joinToString(", ")
}else{
tmp