Skip to content

Commit

Permalink
[fixed] Ignore stale transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
agundermann committed Jan 9, 2015
1 parent 5149d77 commit 1f81286
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/utils/createRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,15 @@ function createRouter(options) {
);

var dispatchHandler = function (error, transition) {
if (error)
onError.call(router, error);

if (pendingTransition !== transition)
return;

pendingTransition = null;

if (error) {
onError.call(router, error);
} else if (transition.isAborted) {
if (transition.isAborted) {
onAbort.call(router, transition.abortReason, location);
} else {
callback.call(router, router, nextState);
Expand Down

0 comments on commit 1f81286

Please sign in to comment.