Skip to content

Commit 39d771f

Browse files
committed
updated with room-state refresh
1 parent 64a28eb commit 39d771f

File tree

1 file changed

+4
-0
lines changed
  • kotlin_client/src/main/java/com/huddle01/kotlin_client/live_data/store

1 file changed

+4
-0
lines changed

kotlin_client/src/main/java/com/huddle01/kotlin_client/live_data/store/HuddleStore.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import com.huddle01.kotlin_client.live_data.store.models.Peers
77
import com.huddle01.kotlin_client.live_data.store.models.RoomInfo
88
import com.huddle01.kotlin_client.models.enum_class.RoomStates
99
import io.github.crow_misia.mediasoup.Consumer
10+
import kotlinx.coroutines.delay
11+
import kotlinx.coroutines.runBlocking
1012
import org.json.JSONObject
1113
import org.webrtc.MediaStreamTrack
1214

@@ -27,6 +29,8 @@ object HuddleStore : ViewModel() {
2729
if (RoomStates.CLOSED == state) {
2830
peers.postValue { it.clear() }
2931
me.postValue { it.clear() }
32+
runBlocking { delay(1500) }
33+
roomInfo.postValue { it.connectionState = RoomStates.IDLE }
3034
}
3135
}
3236

0 commit comments

Comments
 (0)