Fix async usage after update
- change package dir - replace broken kill patch with remove filter
This commit is contained in:
parent
efefad1889
commit
6cdfb96914
3 changed files with 5 additions and 12 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue