Skip to content

Commit

Permalink
Finder: Do not show error messages for suggestions (#42490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar committed Dec 11, 2023
1 parent c4260cb commit 7058430
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build/media_source/com_finder/js/finder.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@
try {
response = JSON.parse(xhr.responseText);
} catch (e) {
Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr, 'parsererror'));
// Something went wrong, but we are not going to bother the enduser with this
// eslint-disable-next-line no-console
console.error(e);
return;
}

if (Object.prototype.toString.call(response.suggestions) === '[object Array]') {
target.awesomplete.list = response.suggestions;
}
}).catch((xhr) => {
Joomla.renderMessages(Joomla.ajaxErrorsMessages(xhr));
// Something went wrong, but we are not going to bother the enduser with this
// eslint-disable-next-line no-console
console.error(xhr);
});
}
};
Expand Down

0 comments on commit 7058430

Please sign in to comment.