Skip to content

Commit

Permalink
Don't trigger fetch:apiError if request is aborted (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
burhandodhy authored Jan 29, 2024
1 parent ff1c36a commit 695a3a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/js/src/models/media-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ var MediaCollection = Backbone.Collection.extend({
return fallback.sync.apply(this, arguments);
},

fetchFail: function () {
fetchFail: function (response, textStatus) {
if (this.pageNumber > 1) {
this.pageNumber--;
}
wpbc.broadcast.trigger('fetch:finished');
wpbc.broadcast.trigger('spinner:off');
wpbc.broadcast.trigger('fetch:apiError');
if (status === 'abort') {
if (textStatus !== 'abort') {
wpbc.broadcast.trigger('fetch:apiError');
}
},

Expand Down

0 comments on commit 695a3a1

Please sign in to comment.