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