🛠️ Fix issues with book loading
* Fixed issue with infinite loading if you open the book two times in a row * Fixed issue with checking for update cancellation
This commit is contained in:
parent
6017f887e1
commit
343e5bc8bd
1 changed files with 4 additions and 3 deletions
|
|
@ -439,6 +439,9 @@ class ReaderViewModel @Inject constructor(
|
|||
yield()
|
||||
|
||||
val result = checkForTextUpdate.execute(bookId = _state.value.book.id)
|
||||
|
||||
yield()
|
||||
|
||||
when (result) {
|
||||
is Resource.Success -> {
|
||||
if (result.data == null) {
|
||||
|
|
@ -601,7 +604,6 @@ class ReaderViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
eventJob.cancel()
|
||||
eventJob.join()
|
||||
eventJob = SupervisorJob()
|
||||
}
|
||||
}
|
||||
|
|
@ -673,9 +675,8 @@ class ReaderViewModel @Inject constructor(
|
|||
return show || !fullscreenMode
|
||||
}
|
||||
|
||||
private suspend fun clear() {
|
||||
private fun clear() {
|
||||
eventJob.cancel()
|
||||
eventJob.join()
|
||||
eventJob = SupervisorJob()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue