Remove the no needed launch.
This commit is contained in:
parent
cfcd7518dc
commit
e1cebc2e95
1 changed files with 6 additions and 9 deletions
|
|
@ -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))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue