Merge pull request #8573 from Tainan404/issue-8569

Show right breakout room in free join mode
This commit is contained in:
Anton Georgiev 2020-01-30 13:17:15 -05:00 committed by GitHub
commit 96e13140e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,10 +76,11 @@ class BreakoutRoomInvitation extends Component {
if (hasBreakouts && !breakoutUserIsIn && !amIModerator) {
// Have to check for freeJoin breakouts first because currentBreakoutUser will
// populate after a room has been joined
const breakoutRoom = getBreakoutByUser(currentBreakoutUser);
const freeJoinBreakout = breakouts.find(breakout => breakout.freeJoin);
if (freeJoinBreakout) {
if (!didSendBreakoutInvite) {
this.inviteUserToBreakout(freeJoinBreakout);
this.inviteUserToBreakout(breakoutRoom || freeJoinBreakout);
this.setState({ didSendBreakoutInvite: true });
}
} else if (currentBreakoutUser) {
@ -87,7 +88,6 @@ class BreakoutRoomInvitation extends Component {
const oldCurrentUser = oldProps.currentBreakoutUser || {};
const oldInsertedTime = oldCurrentUser.insertedTime;
if (currentInsertedTime !== oldInsertedTime) {
const breakoutRoom = getBreakoutByUser(currentBreakoutUser);
const breakoutId = Session.get('lastBreakoutOpened');
if (breakoutRoom.breakoutId !== breakoutId) {
this.inviteUserToBreakout(breakoutRoom);