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
|
|
@ -50,7 +50,7 @@ var paths = {
|
||||||
]),
|
]),
|
||||||
scripts: [
|
scripts: [
|
||||||
'node_modules/jquery/dist/jquery.js',
|
'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',
|
'node_modules/leaflet/dist/leaflet-src.js',
|
||||||
]
|
]
|
||||||
.concat(
|
.concat(
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,10 @@
|
||||||
|
|
||||||
// abort pending requests from previous rerouteAllSegments
|
// abort pending requests from previous rerouteAllSegments
|
||||||
if (!router.queue.idle()) {
|
if (!router.queue.idle()) {
|
||||||
router.queue.kill();
|
router.queue.remove((task) => {
|
||||||
|
task.callback(L.BRouter.ABORTED_ERROR);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
routing.rerouteAllSegments(onUpdate);
|
routing.rerouteAllSegments(onUpdate);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,16 +26,6 @@ L.BRouter = L.Class.extend({
|
||||||
}, this),
|
}, this),
|
||||||
1
|
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) {
|
setOptions: function (options) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue