Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/src/core/room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,8 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {

final isNew = !_remoteParticipants.containsKey(info.identity);

if (info.state == lk_models.ParticipantInfo_State.DISCONNECTED &&
!isNew) {
hasChanged = true;
await _handleParticipantDisconnect(info.identity);
if (info.state == lk_models.ParticipantInfo_State.DISCONNECTED) {
hasChanged = await _handleParticipantDisconnect(info.identity);
continue;
}

Expand Down Expand Up @@ -697,15 +695,16 @@ class Room extends DisposableChangeNotifier with EventsEmittable<RoomEvent> {
events.emit(event);
}

Future<void> _handleParticipantDisconnect(String identity) async {
Future<bool> _handleParticipantDisconnect(String identity) async {
final participant = _remoteParticipants.remove(identity);
if (participant == null) {
return;
return false;
}

await participant.removeAllPublishedTracks(notify: true);

emitWhenConnected(ParticipantDisconnectedEvent(participant: participant));
return true;
}

Future<void> _sendSyncState() async {
Expand Down