diff --git a/app/src/main/java/io/legado/app/constant/EventBus.kt b/app/src/main/java/io/legado/app/constant/EventBus.kt index e111bdc98..06264871c 100644 --- a/app/src/main/java/io/legado/app/constant/EventBus.kt +++ b/app/src/main/java/io/legado/app/constant/EventBus.kt @@ -28,6 +28,6 @@ object EventBus { const val TIP_COLOR = "tipColor" const val SOURCE_CHANGED = "sourceChanged" const val SEARCH_RESULT = "searchResult" - const val BOOK_URL_CHANGED = "bookUrlChanged" + const val FILE_SOURCE_DOWNLOAD_DONE = "fileSourceDownloadDone" const val updateReadActionBar = "updateReadActionBar" } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt b/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt index 4054e0fbd..667c9042c 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt @@ -66,7 +66,7 @@ class ImportOnLineBookFileViewModel(app: Application) : BaseViewModel(app) { fun importOnLineBookFile(url: String, fileName: String, success: () -> Unit) { execute { LocalBook.importFileOnLine(url, fileName, bookSource).let { - postEvent(EventBus.BOOK_URL_CHANGED, it.bookUrl) + postEvent(EventBus.FILE_SOURCE_DOWNLOAD_DONE, it.bookUrl) } }.onSuccess { success.invoke() diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index bc57da9dd..a21ab4aa8 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -535,7 +535,7 @@ class BookInfoActivity : } override fun observeLiveBus() { - observeEvent(EventBus.BOOK_URL_CHANGED) { + observeEvent(EventBus.FILE_SOURCE_DOWNLOAD_DONE) { viewModel.changeToLocalBook(it) } }