Skip to content

Commit

Permalink
fix: call error callbacks with right arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
troch committed Sep 4, 2015
1 parent 94e1212 commit bde616c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/router5.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ class Router5 {

if (!path) {
if (done) done(constants.ROUTE_NOT_FOUND)
this._invokeListeners('$error', toState, fromState, constants.ROUTE_NOT_FOUND)
this._invokeListeners('$error', null, this.lastKnownState, constants.ROUTE_NOT_FOUND)
return
}

Expand All @@ -574,7 +574,7 @@ class Router5 {
// (no desactivation and no callbacks)
if (sameStates && !opts.reload) {
if (done) done(constants.SAME_STATES)
this._invokeListeners('$error', toState, fromState, constants.SAME_STATES)
this._invokeListeners('$error', toState, this.lastKnownState, constants.SAME_STATES)
return
}

Expand Down

0 comments on commit bde616c

Please sign in to comment.