Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue/1582: _canNavigate after router:navigate #1688

Merged
merged 3 commits into from
Aug 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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