自习室优化ok
This commit is contained in:
@@ -176,7 +176,13 @@ class TchRoomVM extends ChangeNotifier {
|
||||
|
||||
///学生人员变化事件,(如加入、退出、掉线)
|
||||
void onStudentChange(List<RoomUserDto> list) {
|
||||
_students = list.where((t) => t.userType != 2).toList();
|
||||
_students = list.where((t) => t.userType != 2 && t.online == 1).toList();
|
||||
if (activeSId != 0) {
|
||||
final it = _students.where((t) => t.userId == activeSId).firstOrNull;
|
||||
if (it == null) {
|
||||
activeSId = 0;
|
||||
}
|
||||
}
|
||||
// 如果当前没有学生,则选择第一个
|
||||
if (activeSId == 0 && _students.isNotEmpty) {
|
||||
activeSId = _students.first.userId;
|
||||
|
||||
Reference in New Issue
Block a user