From d35a0c5e1e4f26e1650b1a7b04552afa22b7cb8e Mon Sep 17 00:00:00 2001 From: Koitharu Date: Thu, 3 Apr 2025 19:41:44 +0300 Subject: [PATCH] Allow to open reader when details is not loaded yet --- .../org/koitharu/kotatsu/details/ui/ReadButtonDelegate.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/ReadButtonDelegate.kt b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/ReadButtonDelegate.kt index a93b8e472..045461f4f 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/ReadButtonDelegate.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/ReadButtonDelegate.kt @@ -125,15 +125,16 @@ class ReadButtonDelegate( } private fun onHistoryChanged(isLoading: Boolean, info: HistoryInfo) { + val isChaptersLoading = isLoading && (info.totalChapters <= 0 || info.isChapterMissing) buttonRead.setText( when { - isLoading -> R.string.loading_ + isChaptersLoading -> R.string.loading_ info.isIncognitoMode -> R.string.incognito info.canContinue -> R.string._continue else -> R.string.read }, ) - splitButton.isEnabled = !isLoading && info.isValid + splitButton.isEnabled = !isChaptersLoading && info.isValid } private fun Menu.populateBranchList() {