Skip to content

Commit

Permalink
issue/1582: _canNavigate after router:navigate (#1688)
Browse files Browse the repository at this point in the history
* issue/1582: _canNavigate after router:navigate

* issue/1582: removed variable caching

* issue/1582: removed whitespace
  • Loading branch information
oliverfoster authored and brian-learningpool committed Aug 2, 2017
1 parent 0ff7731 commit 3622a67
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ define([
handleRoute: function() {
var args = this.pruneArguments(arguments);

var canNavigate = Adapt.router.get('_canNavigate');

if (canNavigate) {
if (Adapt.router.get('_canNavigate')) {
// Reset _isCircularNavigationInProgress protection as code is allowed to navigate away
this._isCircularNavigationInProgress = false;
}
Expand All @@ -61,7 +59,8 @@ define([
Adapt.trigger("router:navigate", args);
}

if (canNavigate) {
// recheck as _canNavigate can be set to false on router:navigate event
if (Adapt.router.get('_canNavigate')) {

//disable navigation whilst rendering
Adapt.router.set('_canNavigate', false, {pluginName: "adapt"});
Expand Down

0 comments on commit 3622a67

Please sign in to comment.