From e97b2630ceff9d598169822d53405c7d245235fc Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 17 Aug 2019 16:50:52 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/readbook/ReadBookViewModel.kt | 12 ++++++++++++ 1 file changed, 12 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 c0f0fa3e7..046ebd51e 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 @@ -80,6 +80,10 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } } ?: download(book, chapter) } + }.onError { + synchronized(loadingLock) { + loadingChapters.remove(index) + } } } @@ -94,6 +98,10 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { download(book, chapter) } } + }.onError { + synchronized(loadingLock) { + loadingChapters.remove(index) + } } } @@ -107,6 +115,10 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { loadingChapters.remove(chapter.index) } } + }?.onError { + synchronized(loadingLock) { + loadingChapters.remove(chapter.index) + } } }