File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
app/src/main/java/io/agora/flat/ui/activity/play Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ class ClassRoomViewModel @Inject constructor(
161161 joinBoard()
162162 syncInitState()
163163 observerUserState()
164- if (quickStart) startClass ()
164+ checkAndStartClassAsOwner ()
165165 }
166166 }
167167 }
@@ -631,6 +631,15 @@ class ClassRoomViewModel @Inject constructor(
631631 }
632632 }
633633
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+
634643 private fun startClass () {
635644 viewModelScope.launch {
636645 val state = _state .value ? : return @launch
You can’t perform that action at this time.
0 commit comments