mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Rewrite condition for better clarity
This commit is contained in:
parent
aa53105f17
commit
620bebc3a3
@ -30,7 +30,6 @@ import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
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.session.Session
|
||||
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()
|
||||
}
|
||||
.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
|
||||
getMostRecentRelatedEventFlow(room, voiceBroadcast)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user