revert: Partially revert "refactor: Attempt 2 on getting library manga

using flow"

It updates on "mark as read" from library, but didn't respond to changes
outside of library page. It probably easier if I move the variable to
ViewModel...
This commit is contained in:
Ahmad Ansori Palembani 2024-06-19 16:52:30 +07:00
parent 7b765a5fc2
commit 6a2704ff11
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -184,7 +184,7 @@ class LibraryPresenter(
presenterScope.launch { presenterScope.launch {
getLibraryManga.subscribe().collectLatest { getLibraryManga.subscribe().collectLatest {
libraryManga = it.apply { if (groupType > BY_DEFAULT) { distinctBy { it.id } } } libraryManga = it.apply { if (groupType > BY_DEFAULT) { distinctBy { it.id } } }
getLibrary() getLibrary(false)
} }
} }
if (!preferences.showLibrarySearchSuggestions().isSet()) { if (!preferences.showLibrarySearchSuggestions().isSet()) {
@ -210,7 +210,7 @@ class LibraryPresenter(
} }
/** Get favorited manga for library and sort and filter it */ /** Get favorited manga for library and sort and filter it */
fun getLibrary(forceFetch: Boolean = false) { fun getLibrary(forceFetch: Boolean = true) {
presenterScope.launch { presenterScope.launch {
if (categories.isEmpty()) { if (categories.isEmpty()) {
val dbCategories = getCategories.await() val dbCategories = getCategories.await()