mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-13 12:38:58 +01:00
MangaPresenter: Add distinctUntilChanged to db flow (#7629)
* MangaScreen: Disable swipe refresh on action mode * MangaPresenter: Add distinctUntilChanged to db flow Now will only emit update when the related entry is changed
This commit is contained in:
@@ -59,6 +59,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.catch
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.map
|
||||
@@ -171,6 +172,7 @@ class MangaPresenter(
|
||||
}
|
||||
|
||||
getMangaAndChapters.subscribe(mangaId)
|
||||
.distinctUntilChanged()
|
||||
.collectLatest { (manga, chapters) ->
|
||||
val chapterItems = chapters.toChapterItems(
|
||||
context = view?.activity ?: Injekt.get<Application>(),
|
||||
|
||||
Reference in New Issue
Block a user