Skip to content

Commit

Permalink
Allow pop but dont throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
zebulgar committed Jan 27, 2016
1 parent c9359a1 commit 0fe8ba5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Actions {
router = router.parentRoute.parent;
debug("Switching to parent router="+router.name);
} else {
return false;
break;
}
}
if (router.pop()){
Expand Down
4 changes: 2 additions & 2 deletions Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default class Router {

pop(num: number = 1){
if (this._stack.length <= num){
throw new Error("Cannot pop(), stack=["+this._stack+"]");
return false;
}
this.nextRoute = null;
if (this.delegate.onPop && this.delegate.onPop(num)){
Expand All @@ -219,4 +219,4 @@ export default class Router {

function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
}

0 comments on commit 0fe8ba5

Please sign in to comment.