From a87a77083e151c3e10cc1c45e3f890378f68f0d4 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Thu, 23 Nov 2023 12:42:43 +0200 Subject: [PATCH] Reader fixes --- .../kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt index 7637cf0ae..6b8af28b1 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt @@ -27,7 +27,6 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.update import kotlinx.coroutines.plus -import org.koitharu.kotatsu.BuildConfig import org.koitharu.kotatsu.R import org.koitharu.kotatsu.bookmarks.domain.Bookmark import org.koitharu.kotatsu.bookmarks.domain.BookmarksRepository @@ -263,8 +262,8 @@ class ReaderViewModel @Inject constructor( stateChangeJob = launchJob(Dispatchers.Default) { prevJob?.cancelAndJoin() loadingJob?.join() - if (BuildConfig.DEBUG && pages.size != content.value.pages.size) { - throw IllegalStateException("Concurrent pages modification") + if (pages.size != content.value.pages.size) { + return@launchJob // TODO } pages.getOrNull(position)?.let { page -> currentState.update { cs ->