Skip to content

Commit

Permalink
$.Deferred().then() returns a different object to $.Deferred().done()…
Browse files Browse the repository at this point in the history
…. Only the latter as an abort() method
  • Loading branch information
simonbrent committed Mar 10, 2022
1 parent 6e2a71b commit c361a8a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/js/Track/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,20 @@ export default Base.extend({
data : this.urlParams,
dataType : this.dataType,
xhrFields : this.xhrFields,
}).then(
}).done(
(data) => {
this.receiveData(data, chr, bin[0], bin[1]);
}
).catch(
).fail(
(xhr, statusText, ...args) => {
this.track.controller.showError(
this.showServerErrors && xhr.responseJSON?.message
? xhr.responseJSON.message
: `${statusText} while getting the data, see console for more details`,
[ xhr, statusText, ...args ]
);
if (this.track?.controller?.showError) {
this.track.controller.showError(
this.showServerErrors && xhr.responseJSON?.message
? xhr.responseJSON.message
: `${statusText} while getting the data, see console for more details`,
[ xhr, statusText, ...args ]
);
}
}
).always(
() => {
Expand Down

0 comments on commit c361a8a

Please sign in to comment.