From 86e59b46d91d3216657ab5400b4117245d72814b Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Jul 2021 22:11:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index 92aeb6ca2..ebafa58d0 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -11,6 +11,7 @@ import io.legado.app.data.entities.BookChapter import io.legado.app.data.entities.BookProgress import io.legado.app.help.AppConfig import io.legado.app.help.BookHelp +import io.legado.app.help.ContentProcessor import io.legado.app.help.storage.BookWebDav import io.legado.app.model.localBook.LocalBook import io.legado.app.model.webBook.PreciseSearch @@ -302,8 +303,10 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { */ fun replaceRuleChanged() { execute { - ReadBook.contentProcessor?.upReplaceRules() - ReadBook.loadContent(resetPageOffset = false) + ReadBook.book?.let { + ContentProcessor.get(it.name, it.origin).upReplaceRules() + ReadBook.loadContent(resetPageOffset = false) + } } }