mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Remove the no needed launch.
This commit is contained in:
+6
-9
@@ -68,7 +68,6 @@ import kotlinx.coroutines.flow.launchIn
|
|||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
import kotlinx.coroutines.flow.onEach
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.flow.onStart
|
import kotlinx.coroutines.flow.onStart
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.matrix.rustcomponents.sdk.RoomInfo
|
import org.matrix.rustcomponents.sdk.RoomInfo
|
||||||
import org.matrix.rustcomponents.sdk.RoomInfoListener
|
import org.matrix.rustcomponents.sdk.RoomInfoListener
|
||||||
@@ -104,14 +103,12 @@ class RustMatrixRoom(
|
|||||||
override val roomId = RoomId(innerRoom.id())
|
override val roomId = RoomId(innerRoom.id())
|
||||||
|
|
||||||
override val roomInfoFlow: Flow<MatrixRoomInfo> = mxCallbackFlow {
|
override val roomInfoFlow: Flow<MatrixRoomInfo> = mxCallbackFlow {
|
||||||
launch {
|
runCatching { innerRoom.roomInfo() }
|
||||||
runCatching { innerRoom.roomInfo() }
|
.getOrNull()
|
||||||
.getOrNull()
|
?.let(matrixRoomInfoMapper::map)
|
||||||
?.let(matrixRoomInfoMapper::map)
|
?.let { initial ->
|
||||||
?.let { initial ->
|
channel.trySend(initial)
|
||||||
channel.trySend(initial)
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
innerRoom.subscribeToRoomInfoUpdates(object : RoomInfoListener {
|
innerRoom.subscribeToRoomInfoUpdates(object : RoomInfoListener {
|
||||||
override fun call(roomInfo: RoomInfo) {
|
override fun call(roomInfo: RoomInfo) {
|
||||||
channel.trySend(matrixRoomInfoMapper.map(roomInfo))
|
channel.trySend(matrixRoomInfoMapper.map(roomInfo))
|
||||||
|
|||||||
Reference in New Issue
Block a user