1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 17:40:29 +00:00

Fix crash when cancelling more than one HTTP request

Thanks @saqimtiaz
This commit is contained in:
jeremy@jermolene.com 2023-05-03 08:30:58 +01:00
parent 53715bd3fd
commit cc7b857d71

View File

@ -65,9 +65,10 @@ HttpClient.prototype.initiateHttpRequest = function(options) {
HttpClient.prototype.cancelAllHttpRequests = function() {
var self = this;
$tw.utils.each(this.requests,function(requestInfo,index) {
for(var t=this.requests.length - 1; t--; t>=0) {
var requestInfo = this.requests[t];
requestInfo.request.cancel();
});
}
this.requests = [];
this.updateRequestTracker();
};