Skip to content
Snippets Groups Projects
Commit cb062bce authored by Thomas Roos's avatar Thomas Roos
Browse files

Fix bug due to slow api calls and fast submission switching

parent 7afab27e
Branches
Tags
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment