From 148a3eed89f2a7dc0f888db5bbd7022046e25f02 Mon Sep 17 00:00:00 2001 From: DatLag Date: Tue, 14 May 2024 19:59:47 +0200 Subject: [PATCH] minimize edit mutation request --- .../screen/medium/MediumScreenComponent.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreenComponent.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreenComponent.kt index d20f824..1f5fb4e 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreenComponent.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreenComponent.kt @@ -326,13 +326,11 @@ class MediumScreenComponent( } launchIO { - listStatus.emitAll(newData.mapNotNull { it.status }) - } - launchIO { - watchProgress.emitAll(newData.mapNotNull { it.progress }) - } - launchIO { - watchRepeat.emitAll(newData.mapNotNull { it.repeat }) + newData.collect { data -> + data.status?.let { listStatus.emit(it) } + data.progress?.let { watchProgress.emit(it) } + data.repeat?.let { watchRepeat.emit(it) } + } } }