Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Nov 3, 2023
1 parent ae7ef9b commit a6a416b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/io/legado/app/model/webBook/BookList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ object BookList {
Debug.log(bookSource.bookSourceUrl, "┌获取分类", log)
try {
searchBook.kind = analyzeRule.getStringList(ruleKind)?.joinToString(",")
Debug.log(bookSource.bookSourceUrl, "${searchBook.kind}", log)
Debug.log(bookSource.bookSourceUrl, "${searchBook.kind ?: ""}", log)
} catch (e: Exception) {
Debug.log(bookSource.bookSourceUrl, "${e.localizedMessage}", log)
}
Expand Down Expand Up @@ -232,7 +232,7 @@ object BookList {
searchBook.coverUrl = NetworkUtils.getAbsoluteURL(baseUrl, it)
}
}
Debug.log(bookSource.bookSourceUrl, "${searchBook.coverUrl}", log)
Debug.log(bookSource.bookSourceUrl, "${searchBook.coverUrl ?: ""}", log)
} catch (e: java.lang.Exception) {
Debug.log(bookSource.bookSourceUrl, "${e.localizedMessage}", log)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ class BookInfoActivity :
}
}
tvTocView.setOnClickListener {
if (viewModel.chapterListData.value.isNullOrEmpty()) {
toastOnUi(R.string.chapter_list_empty)
return@setOnClickListener
}
viewModel.getBook()?.let { book ->
if (!viewModel.inBookshelf) {
viewModel.saveBook(book) {
Expand Down Expand Up @@ -533,10 +537,6 @@ class BookInfoActivity :
}

private fun openChapterList() {
if (viewModel.chapterListData.value.isNullOrEmpty()) {
toastOnUi(R.string.chapter_list_empty)
return
}
viewModel.getBook()?.let {
tocActivityResult.launch(it.bookUrl)
}
Expand Down

0 comments on commit a6a416b

Please sign in to comment.