mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-18 13:00:18 +03:00
Rewrite condition for better clarity
This commit is contained in:
parent
aa53105f17
commit
620bebc3a3
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,6 @@ import kotlinx.coroutines.flow.flowOf
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.flow.onStart
|
import kotlinx.coroutines.flow.onStart
|
||||||
import kotlinx.coroutines.flow.transformWhile
|
import kotlinx.coroutines.flow.transformWhile
|
||||||
import org.matrix.android.sdk.api.extensions.orTrue
|
|
||||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||||
import org.matrix.android.sdk.api.session.Session
|
import org.matrix.android.sdk.api.session.Session
|
||||||
import org.matrix.android.sdk.api.session.events.model.RelationType
|
import org.matrix.android.sdk.api.session.events.model.RelationType
|
||||||
|
@ -122,7 +121,8 @@ class GetMostRecentVoiceBroadcastStateEventUseCase @Inject constructor(
|
||||||
event.hasValue() && event.get().root.isRedacted().not()
|
event.hasValue() && event.get().root.isRedacted().not()
|
||||||
}
|
}
|
||||||
.flatMapLatest { event ->
|
.flatMapLatest { event ->
|
||||||
if (event.getOrNull()?.root?.isRedacted().orTrue()) {
|
val isRedactedOrNull = !event.hasValue() || event.get().root.isRedacted()
|
||||||
|
if (isRedactedOrNull) {
|
||||||
// event is null or redacted, switch to the latest not redacted event
|
// event is null or redacted, switch to the latest not redacted event
|
||||||
getMostRecentRelatedEventFlow(room, voiceBroadcast)
|
getMostRecentRelatedEventFlow(room, voiceBroadcast)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue