diff --git a/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdatesPager.kt b/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdatesPager.kt index c01a0164..c7ef76fa 100644 --- a/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdatesPager.kt +++ b/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdatesPager.kt @@ -75,10 +75,12 @@ class UpdatesPager @Inject constructor( } }.stateIn(this, SharingStarted.Eagerly, emptyList()) - private val mangaIds = fetchedUpdates.map { updates -> updates.map { it.manga.id } } - .stateIn(this, SharingStarted.Eagerly, emptyList()) - private val chapterIds = fetchedUpdates.map { updates -> updates.map { Triple(it.manga.id, it.chapter.index, it.chapter.id) } } - .stateIn(this, SharingStarted.Eagerly, emptyList()) + private val mangaIds = foldedUpdates.map { updates -> + updates.filterIsInstance().map { it.manga.id } + }.stateIn(this, SharingStarted.Eagerly, emptyList()) + private val chapterIds = foldedUpdates.map { updates -> + updates.filterIsInstance().map { Triple(it.manga.id, it.chapter.index, it.chapter.id) } + }.stateIn(this, SharingStarted.Eagerly, emptyList()) private val changedManga = serverListeners.mangaListener.runningFold(emptyMap()) { manga, updatedMangaIds -> coroutineScope {