Permalink
Browse files

fix(js): prevent generic ajax error when user aborts the ajax call

  • Loading branch information...
jdalsem committed Mar 23, 2016
1 parent b92fca0 commit 1b5a765fae08ada5dd4128ad69ccfb82d0afc2c3
Showing with 5 additions and 0 deletions.
  1. +5 −0 js/lib/ajax.js
View
@@ -102,6 +102,11 @@ elgg.ajax.handleOptions = function(url, options) {
* @private
*/
elgg.ajax.handleAjaxError = function(xhr, status, error) {
if (!xhr.getAllResponseHeaders()) {
// user aborts (like refresh or navigate) do not have headers
return;
}
elgg.register_error(elgg.echo('ajax:error'));
};

0 comments on commit 1b5a765

Please sign in to comment.