Commit ea5fcbba authored by Hidde Leistra's avatar Hidde Leistra

Fix linter errors

parent 27eaa15e
Pipeline #18099 passed with stages
in 3 minutes and 8 seconds
......@@ -104,14 +104,14 @@ class Exams extends React.Component {
updateFeedback = (feedback) => {
var widgets = this.state.widgets
const idx = widgets[this.state.selectedWidgetId].problem.feedback.findIndex(e => { return e.id == feedback.id })
if(idx == -1) widgets[this.state.selectedWidgetId].problem.feedback.push(feedback)
const idx = widgets[this.state.selectedWidgetId].problem.feedback.findIndex(e => { return e.id === feedback.id })
if (idx === -1) widgets[this.state.selectedWidgetId].problem.feedback.push(feedback)
else {
if(feedback.deleted) widgets[this.state.selectedWidgetId].problem.feedback.splice(idx, 1)
if (feedback.deleted) widgets[this.state.selectedWidgetId].problem.feedback.splice(idx, 1)
else widgets[this.state.selectedWidgetId].problem.feedback[idx] = feedback
}
this.setState({
widgets:widgets
widgets: widgets
})
}
......
......@@ -40,8 +40,8 @@ class EditPanel extends React.Component {
}
static getDerivedStateFromProps (nextProps, prevState) {
// In case nothing is set, use an empty function that no-ops
const updateCallback = nextProps.updateCallback || ( _ => {})
// In case nothing is set, use an empty function that no-ops
const updateCallback = nextProps.updateCallback || (_ => {})
if (nextProps.feedback && prevState.id !== nextProps.feedback.id) {
const fb = nextProps.feedback
return {
......@@ -94,7 +94,7 @@ class EditPanel extends React.Component {
} else {
api.post(uri, fb)
.then((response) => {
// Response is the feedback option
// Response is the feedback option
this.state.updateCallback(response)
this.setState({
id: null,
......
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