Merge pull request #2236 from odomu/master

修复问题
pull/2239/head
kunfei 2 years ago committed by GitHub
commit 436a52a07c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -976,7 +976,7 @@ class ReadBookActivity : BaseReadBookActivity(),
Coroutine.async { Coroutine.async {
val source = ReadBook.bookSource ?: throw NoStackTraceException("no book source") val source = ReadBook.bookSource ?: throw NoStackTraceException("no book source")
val payAction = source.getContentRule().payAction val payAction = source.getContentRule().payAction
if (payAction.isNullOrEmpty()) { if (payAction.isNullOrBlank()) {
throw NoStackTraceException("no pay action") throw NoStackTraceException("no pay action")
} }
val analyzeRule = AnalyzeRule(book, source) val analyzeRule = AnalyzeRule(book, source)
@ -984,9 +984,9 @@ class ReadBookActivity : BaseReadBookActivity(),
analyzeRule.chapter = chapter analyzeRule.chapter = chapter
analyzeRule.evalJS(payAction).toString() analyzeRule.evalJS(payAction).toString()
}.onSuccess { }.onSuccess {
if (it.isNotBlank()) { if (it.isAbsUrl()) {
startActivity<WebViewActivity> { startActivity<WebViewActivity> {
putExtra("title", R.string.chapter_pay) putExtra("title", getString(R.string.chapter_pay))
putExtra("url", it) putExtra("url", it)
IntentData.put(it, ReadBook.bookSource?.getHeaderMap(true)) IntentData.put(it, ReadBook.bookSource?.getHeaderMap(true))
} }

Loading…
Cancel
Save