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

This commit is contained in:
Regis 2017-05-04 07:32:23 -06:00
parent 082b868ecd
commit c59f80ff2d
2 changed files with 2 additions and 7 deletions

View File

@ -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) {

View File

@ -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);
},
});