Commit c59f80ff authored by Regis's avatar Regis

change error handling for api callback - check length is not zero on jquery el

parent 082b868e
......@@ -15,7 +15,7 @@ export default (newStateData, tasks) => {
tasksStates.currentState = tasks.indexOf('0 of 0') === 0;
}
if ($tasks && !tasksStates.newState) {
if ($tasks.length !== 0 && !tasksStates.newState) {
$tasks.text(newStateData.task_status);
$tasksShort.text(newStateData.task_status);
} else if (tasksStates.currentState) {
......
......@@ -25,12 +25,7 @@ export default {
this.renderResponse(res);
},
errorCallback: (err) => {
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-console
console.error('ISSUE SHOW REALTIME ERROR', err, err.stack);
} else {
throw new Error(err);
}
throw new Error(err);
},
});
......
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