Fix async usage after update

- change package dir
- replace broken kill patch with remove filter
This commit is contained in:
Norbert Renner 2022-05-17 11:27:43 +02:00
parent efefad1889
commit 6cdfb96914
3 changed files with 5 additions and 12 deletions

View file

@ -50,7 +50,7 @@ var paths = {
]),
scripts: [
'node_modules/jquery/dist/jquery.js',
'node_modules/async/lib/async.js',
'node_modules/async/dist/async.js',
'node_modules/leaflet/dist/leaflet-src.js',
]
.concat(

View file

@ -213,7 +213,10 @@
// abort pending requests from previous rerouteAllSegments
if (!router.queue.idle()) {
router.queue.kill();
router.queue.remove((task) => {
task.callback(L.BRouter.ABORTED_ERROR);
return true;
});
}
routing.rerouteAllSegments(onUpdate);
}

View file

@ -26,16 +26,6 @@ L.BRouter = L.Class.extend({
}, this),
1
);
// patch to call callbacks on kill for cleanup (loadingTrailer)
this.queue.kill = function () {
var aborted = this.tasks;
this.drain = null;
this.tasks = [];
aborted.forEach(function (task) {
task.callback(L.BRouter.ABORTED_ERROR);
});
};
},
setOptions: function (options) {