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:
parent
bfe705c0e6
commit
b8ec29d8c7
@ -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,
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user