mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
add 1 second timeout to fetching chapters after reader transition
shouldn't ever happen but if someone has a reaaaally bad cpu/storage, they wont be stuck
This commit is contained in:
parent
c05cb6c31a
commit
4ffa72c56f
1 changed files with 3 additions and 1 deletions
|
@ -111,6 +111,7 @@ import eu.kanade.tachiyomi.util.view.toolbarHeight
|
|||
import eu.kanade.tachiyomi.util.view.withFadeTransaction
|
||||
import eu.kanade.tachiyomi.widget.LinearLayoutManagerAccurateOffset
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
import timber.log.Timber
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
@ -578,7 +579,8 @@ class MangaDetailsController :
|
|||
if (!returningFromReader) return
|
||||
returningFromReader = false
|
||||
runBlocking {
|
||||
val chapters = presenter.getChaptersNow()
|
||||
val chapters =
|
||||
withTimeoutOrNull(1000) { presenter.getChaptersNow() } ?: return@runBlocking
|
||||
tabletAdapter?.notifyItemChanged(0)
|
||||
adapter?.setChapters(chapters)
|
||||
addMangaHeader()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue