From 633239961ab7c48d9e10b33abb6888025d3f9c21 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Jan 2021 19:02:35 +0600 Subject: [PATCH] update FlowsUsh --- .../tgbotapi/updateshandlers/FlowsUpdatesFilter.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt index ddf006e887..e44d863dd5 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt @@ -16,11 +16,11 @@ class FlowsUpdatesFilter( val allUpdatesFlow: Flow = updatesSharedFlow.asSharedFlow() @Suppress("MemberVisibilityCanBePrivate") val allUpdatesWithoutMediaGroupsGroupingFlow: Flow = updatesSharedFlow.flatMapConcat { - (if (it is SentMediaGroupUpdate) { - it.origins - } else { - listOf(it) - }).asFlow() + when (it) { + is SentMediaGroupUpdate -> it.origins.asFlow() + is EditMediaGroupUpdate -> flowOf(it.origin) + else -> flowOf(it) + } } override val allowedUpdates: List