Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Commit

Permalink
page transition race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyWebb committed Jul 19, 2016
1 parent ddbf794 commit 91c0eea
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions dist/ko-component-router.js
Expand Up @@ -347,7 +347,6 @@ return /******/ (function(modules) { // webpackBootstrap
var push = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
var query = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];

// debugger
var url = this.resolveUrl(origUrl);
var route = this.getRouteForUrl(url);
var firstRun = this.route() === '';
Expand All @@ -373,7 +372,7 @@ return /******/ (function(modules) { // webpackBootstrap

var samePage = this.pathname() === pathname;

var shouldNavigatePromise = samePage ? this.$child ? this.$child.update(childPath || '/', false, false, false) : Promise.resolve(true) : this.runBeforeNavigateCallbacks();
var shouldNavigatePromise = samePage ? this.$child ? this.$child.update(childPath || '/', state, false, query) : Promise.resolve(true) : this.runBeforeNavigateCallbacks();

return shouldNavigatePromise.then(function (shouldNavigate) {
if (!shouldNavigate) {
Expand Down
2 changes: 1 addition & 1 deletion dist/ko-component-router.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/dist/bundle.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions lib/context.js
Expand Up @@ -80,7 +80,6 @@ var Context = function () {
var push = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
var query = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];

// debugger
var url = this.resolveUrl(origUrl);
var route = this.getRouteForUrl(url);
var firstRun = this.route() === '';
Expand All @@ -106,7 +105,7 @@ var Context = function () {

var samePage = this.pathname() === pathname;

var shouldNavigatePromise = samePage ? this.$child ? this.$child.update(childPath || '/', false, false, false) : Promise.resolve(true) : this.runBeforeNavigateCallbacks();
var shouldNavigatePromise = samePage ? this.$child ? this.$child.update(childPath || '/', state, false, query) : Promise.resolve(true) : this.runBeforeNavigateCallbacks();

return shouldNavigatePromise.then(function (shouldNavigate) {
if (!shouldNavigate) {
Expand Down
3 changes: 1 addition & 2 deletions src/context.js
Expand Up @@ -46,7 +46,6 @@ export default class Context {
}

update(origUrl = this.canonicalPath(), state = false, push = true, query = false) {
// debugger
const url = this.resolveUrl(origUrl)
const route = this.getRouteForUrl(url)
const firstRun = this.route() === ''
Expand All @@ -62,7 +61,7 @@ export default class Context {
const shouldNavigatePromise =
samePage
? this.$child
? this.$child.update(childPath || '/', false, false, false)
? this.$child.update(childPath || '/', state, false, query)
: Promise.resolve(true)
: this.runBeforeNavigateCallbacks()

Expand Down

0 comments on commit 91c0eea

Please sign in to comment.