Retain previous selected state when updating list states

Fixes #8417
This commit is contained in:
arkon
2022-11-13 22:27:59 -05:00
parent b1ccebf329
commit 10e349f76e
7 changed files with 79 additions and 56 deletions
@@ -31,8 +31,8 @@ class MigrateMangaPresenter(
presenterScope.launchIO {
getFavorites
.subscribe(sourceId)
.catch { exception ->
logcat(LogPriority.ERROR, exception)
.catch {
logcat(LogPriority.ERROR, it)
_events.send(Event.FailedFetchingFavorites)
}
.map { list ->
@@ -32,8 +32,8 @@ class MigrationSourcesPresenter(
fun onCreate() {
presenterScope.launchIO {
getSourcesWithFavoriteCount.subscribe()
.catch { exception ->
logcat(LogPriority.ERROR, exception)
.catch {
logcat(LogPriority.ERROR, it)
_channel.send(Event.FailedFetchingSourcesWithCount)
}
.collectLatest { sources ->
@@ -40,8 +40,8 @@ class SourcesPresenter(
fun onCreate() {
presenterScope.launchIO {
getEnabledSources.subscribe()
.catch { exception ->
logcat(LogPriority.ERROR, exception)
.catch {
logcat(LogPriority.ERROR, it)
_events.send(Event.FailedFetchingSources)
}
.onStart { delay(500) } // Defer to avoid crashing on initial render