Handle async cache in updates and manga screens
- Also fix concurrent accesses to main cache map - Also debounce sources and updates list updates to maybe avoid crashing due to dupe LazyColumn keys
This commit is contained in:
@@ -16,6 +16,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.catch
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.flow.debounce
|
||||
import kotlinx.coroutines.flow.receiveAsFlow
|
||||
import logcat.LogPriority
|
||||
import uy.kohesive.injekt.Injekt
|
||||
@@ -38,6 +39,7 @@ class SourcesPresenter(
|
||||
fun onCreate() {
|
||||
presenterScope.launchIO {
|
||||
getEnabledSources.subscribe()
|
||||
.debounce(500) // Avoid crashes due to LazyColumn rendering
|
||||
.catch { exception ->
|
||||
logcat(LogPriority.ERROR, exception)
|
||||
_events.send(Event.FailedFetchingSources)
|
||||
|
||||
Reference in New Issue
Block a user