From 9b93cfade53c840f305b329be9297881e985b084 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 27 Aug 2019 17:52:18 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/readbook/ReadBookViewModel.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt index 85de3fc04..b02beea94 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt @@ -167,7 +167,13 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { App.db.bookChapterDao().getChapter(book.bookUrl, index)?.let { chapter -> if (!BookHelp.hasContent(book, chapter)) { download(book, chapter) + } else { + synchronized(loadingLock) { + loadingChapters.remove(index) + } } + } ?: synchronized(loadingLock) { + loadingChapters.remove(index) } }.onError { synchronized(loadingLock) {