Properly modify StateFlow value (#7059)
This commit is contained in:
+2
-2
@@ -27,10 +27,10 @@ class MigrationMangaPresenter(
|
||||
getFavoritesBySourceId
|
||||
.subscribe(sourceId)
|
||||
.catch { exception ->
|
||||
_state.emit(MigrateMangaState.Error(exception))
|
||||
_state.value = MigrateMangaState.Error(exception)
|
||||
}
|
||||
.collectLatest { list ->
|
||||
_state.emit(MigrateMangaState.Success(list))
|
||||
_state.value = MigrateMangaState.Success(list)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -28,10 +28,10 @@ class MigrationSourcesPresenter(
|
||||
presenterScope.launchIO {
|
||||
getSourcesWithFavoriteCount.subscribe()
|
||||
.catch { exception ->
|
||||
_state.emit(MigrateSourceState.Error(exception))
|
||||
_state.value = MigrateSourceState.Error(exception)
|
||||
}
|
||||
.collectLatest { sources ->
|
||||
_state.emit(MigrateSourceState.Success(sources))
|
||||
_state.value = MigrateSourceState.Success(sources)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,11 +31,11 @@ class SourceFilterPresenter(
|
||||
presenterScope.launchIO {
|
||||
getLanguagesWithSources.subscribe()
|
||||
.catch { exception ->
|
||||
_state.emit(SourceFilterState.Error(exception))
|
||||
_state.value = SourceFilterState.Error(exception)
|
||||
}
|
||||
.collectLatest { sourceLangMap ->
|
||||
val uiModels = sourceLangMap.toFilterUiModels()
|
||||
_state.emit(SourceFilterState.Success(uiModels))
|
||||
_state.value = SourceFilterState.Success(uiModels)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class SourcePresenter(
|
||||
presenterScope.launchIO {
|
||||
getEnabledSources.subscribe()
|
||||
.catch { exception ->
|
||||
_state.emit(SourceState.Error(exception))
|
||||
_state.value = SourceState.Error(exception)
|
||||
}
|
||||
.collectLatest(::collectLatestSources)
|
||||
}
|
||||
@@ -71,7 +71,7 @@ class SourcePresenter(
|
||||
}.toTypedArray(),
|
||||
)
|
||||
}
|
||||
_state.emit(SourceState.Success(uiModels))
|
||||
_state.value = SourceState.Success(uiModels)
|
||||
}
|
||||
|
||||
fun toggleSource(source: Source) {
|
||||
|
||||
Reference in New Issue
Block a user