mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 11:26:01 +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.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 a new issue