Skip to content

Commit acd0806

Browse files
committed
Correct order of hand raised users for users who just connected
1 parent 729c61a commit acd0806

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

frontend/src/app/video-room/video-room.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
611611
this.publishSession(this.localUsers[0]).then(() => {
612612
this.sendSignalUserChanged(this.localUsers[0], true);
613613
this.joinSession.emit();
614+
this.overrideHandRaisedUsers();
614615
})
615616
.catch((error) => console.error(error));
616617
this.localUsers[0].getStreamManager().on('streamPlaying', () => {
@@ -620,7 +621,9 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
620621
} else {
621622
this.localUsers[0].setVideoActive(false);
622623
this.localUsers[0].setAudioActive(false);
624+
this.localUsers[0].setScreenShareActive(false);
623625
this.sendSignalUserChanged(this.localUsers[0], true);
626+
this.overrideHandRaisedUsers();
624627
}
625628
}
626629

@@ -724,6 +727,17 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
724727
this.handsRaisedMessage = (this.handsRaised.length>1 ? 'And ' + (this.handsRaised.length-1) + ' other ' + (this.handsRaised.length===2 ? 'person' : 'people') + ' are' : 'Is') + ' raising their hand'
725728
}
726729

730+
private overrideHandRaisedUsers() {
731+
this.roomService.getHandRaisedUsers(this.mySessionId).subscribe(
732+
(users) => {
733+
users.forEach((user, index) => {
734+
this.handsRaised[index] = user;
735+
});
736+
},
737+
error => console.log(error)
738+
);
739+
}
740+
727741
private subscribedToStreamDestroyed() {
728742
this.session.on('streamDestroyed', (event: StreamEvent) => {
729743
this.deleteRemoteStream(event.stream);

0 commit comments

Comments
 (0)