Skip to content

Commit 53fc2f3

Browse files
committed
Remove the no needed launch.
1 parent 3c3781d commit 53fc2f3

File tree

1 file changed

+6
-9
lines changed
  • libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room

1 file changed

+6
-9
lines changed

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ import kotlinx.coroutines.flow.launchIn
6868
import kotlinx.coroutines.flow.map
6969
import kotlinx.coroutines.flow.onEach
7070
import kotlinx.coroutines.flow.onStart
71-
import kotlinx.coroutines.launch
7271
import kotlinx.coroutines.withContext
7372
import org.matrix.rustcomponents.sdk.RoomInfo
7473
import org.matrix.rustcomponents.sdk.RoomInfoListener
@@ -104,14 +103,12 @@ class RustMatrixRoom(
104103
override val roomId = RoomId(innerRoom.id())
105104

106105
override val roomInfoFlow: Flow<MatrixRoomInfo> = mxCallbackFlow {
107-
launch {
108-
runCatching { innerRoom.roomInfo() }
109-
.getOrNull()
110-
?.let(matrixRoomInfoMapper::map)
111-
?.let { initial ->
112-
channel.trySend(initial)
113-
}
114-
}
106+
runCatching { innerRoom.roomInfo() }
107+
.getOrNull()
108+
?.let(matrixRoomInfoMapper::map)
109+
?.let { initial ->
110+
channel.trySend(initial)
111+
}
115112
innerRoom.subscribeToRoomInfoUpdates(object : RoomInfoListener {
116113
override fun call(roomInfo: RoomInfo) {
117114
channel.trySend(matrixRoomInfoMapper.map(roomInfo))

0 commit comments

Comments
 (0)