🛠️ Small fixes & improvements in Reader loading

* Preventing error from showing (after successful load)
* Removed unnecessary delay
This commit is contained in:
Acclorite 2024-10-07 17:28:28 +03:00
parent 0fb950ff57
commit 5728253988

View file

@ -103,10 +103,10 @@ class ReaderViewModel @Inject constructor(
event.checkForUpdate()
delay(100)
_state.update {
it.copy(
loading = false
loading = false,
errorMessage = null
)
}
@ -526,7 +526,7 @@ class ReaderViewModel @Inject constructor(
}
clear()
launch {
withContext(Dispatchers.Default) {
onEvent(
ReaderEvent.OnShowHideMenu(
show = false,
@ -535,6 +535,8 @@ class ReaderViewModel @Inject constructor(
activity = activity
)
)
}
onEvent(
ReaderEvent.OnLoadText(
checkForUpdate = {
@ -557,7 +559,6 @@ class ReaderViewModel @Inject constructor(
)
}
}
}
@OptIn(FlowPreview::class)
fun onUpdateProgress(refreshList: (Book) -> Unit) {