Commit cb062bce authored by Thomas Roos's avatar Thomas Roos

Fix bug due to slow api calls and fast submission switching

parent 7afab27e
......@@ -245,7 +245,8 @@ class CheckStudents extends React.Component {
api.get('submissions/' + this.state.exam.id + '/' + this.state.submission.id)
.then(sub => {
let newList = this.state.submission.list;
newList[this.state.submission.index] = sub;
const index = newList.findIndex(localSub => localSub.id === sub.id)
newList[index] = sub;
this.setState({
submission: {
...this.state.submission,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment