Fix randomly assign problem in breakout rooms

The problem was caused because of PureComponent shallow
comparison, the users list in state are not changing his
reference

close #7905
This commit is contained in:
Joao Siebel 2019-08-28 12:56:56 -03:00
parent bfe705c0e6
commit b8ec29d8c7

View File

@ -353,9 +353,13 @@ class BreakoutRoom extends PureComponent {
const { users } = this.state;
const idxUser = users.findIndex(user => user.userId === userId);
users[idxUser].room = room;
const usersCopy = [...users];
usersCopy[idxUser].room = room;
this.setState({
users,
users: usersCopy,
valid: this.getUserByRoom(0).length !== users.length,
});
}