We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d93073b commit 222f63dCopy full SHA for 222f63d
1 file changed
app/src/main/java/io/agora/flat/ui/activity/play/ClassRoomViewModel.kt
@@ -161,7 +161,7 @@ class ClassRoomViewModel @Inject constructor(
161
joinBoard()
162
syncInitState()
163
observerUserState()
164
- if (quickStart) startClass()
+ checkAndStartClassAsOwner()
165
}
166
167
@@ -631,6 +631,15 @@ class ClassRoomViewModel @Inject constructor(
631
632
633
634
+ private fun checkAndStartClassAsOwner() {
635
+ val state = _state.value ?: return
636
+
637
+ if (state.isOwner && state.roomStatus == RoomStatus.Idle) {
638
+ logger.d("Owner joined an Idle room, triggering startClass...")
639
+ startClass()
640
+ }
641
642
643
private fun startClass() {
644
viewModelScope.launch {
645
val state = _state.value ?: return@launch
0 commit comments