fixes
This commit is contained in:
parent
db2d0cb981
commit
0c00ab350d
2 changed files with 3 additions and 4 deletions
|
|
@ -55,6 +55,7 @@ class WebViewActivity : BaseActivity() {
|
||||||
generateBtn = toolbar.findViewById(R.id.generate)
|
generateBtn = toolbar.findViewById(R.id.generate)
|
||||||
webViewCompose = findViewById(R.id.webview_compose)
|
webViewCompose = findViewById(R.id.webview_compose)
|
||||||
cookieManager = CookieManager.getInstance()
|
cookieManager = CookieManager.getInstance()
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this@WebViewActivity)
|
preferences = PreferenceManager.getDefaultSharedPreferences(this@WebViewActivity)
|
||||||
|
|
||||||
webViewClient = object : AccompanistWebViewClient() {
|
webViewClient = object : AccompanistWebViewClient() {
|
||||||
|
|
@ -62,13 +63,11 @@ class WebViewActivity : BaseActivity() {
|
||||||
super.onPageFinished(view, url)
|
super.onPageFinished(view, url)
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
toolbar.title = view?.title ?: ""
|
toolbar.title = view?.title ?: ""
|
||||||
cookies = CookieManager.getInstance().getCookie(view?.url)
|
cookies = cookieManager.getCookie(view?.url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cookieManager = CookieManager.getInstance()
|
|
||||||
|
|
||||||
toolbar.setNavigationOnClickListener {
|
toolbar.setNavigationOnClickListener {
|
||||||
cookieManager.flush()
|
cookieManager.flush()
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ object Extensions {
|
||||||
runCatching {
|
runCatching {
|
||||||
val tmp = this.getString(it)
|
val tmp = this.getString(it)
|
||||||
if (tmp != "null") {
|
if (tmp != "null") {
|
||||||
return if (tmp.startsWith("[")) {
|
return if (tmp.startsWith("[") && tmp.endsWith("]")) {
|
||||||
Json.decodeFromString<List<String>>(tmp).joinToString(", ")
|
Json.decodeFromString<List<String>>(tmp).joinToString(", ")
|
||||||
}else{
|
}else{
|
||||||
tmp
|
tmp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue