Fix reader

This commit is contained in:
Syer10
2025-10-04 16:14:18 -04:00
parent c5553b0512
commit f4df0917fb
2 changed files with 2 additions and 2 deletions

View File

@@ -164,7 +164,7 @@ class ChapterRepositoryImpl(
): Flow<ByteArray> {
val realUrl = Url("$serverUrl$url")
return flow { http.get(realUrl, block).readBytes() }
return flow { emit(http.get(realUrl, block).readBytes()) }
}
companion object {

View File

@@ -192,8 +192,8 @@ class TachideskPageLoader(
currentPage: ReaderPage,
amount: Int,
): List<PriorityPage> {
val pageIndex = currentPage.index2
val pages = (currentPage.chapter.pages.value as? PagesState.Success)?.pages ?: return emptyList()
val pageIndex = pages.indexOf(currentPage)
if (pageIndex >= pages.lastIndex) return emptyList()
return pages