Closed PedroHurtado closed 9 years ago
I think this is the same as a bug that was found yesterday in issue https://github.com/erikringsmuth/app-router/issues/51, PR https://github.com/erikringsmuth/app-router/pull/52. Try pulling version 2.3.1 and see if that fixes it.
I also realized there's another bug with this line. https://github.com/erikringsmuth/app-router/blob/master/src/app-router.js#L145
It needs an additional check at the end.
&& url.hash !== previousUrl.hash
I think this is what you're seeing.
I fixed this and pushed version 2.3.2 https://github.com/erikringsmuth/app-router/commit/1bd2d50d2b51c0c5f87d70c203aa5a8295929aac. It will refresh by default now.
thanks;)
refresch options passed in value to true when we call the method go. In a scenario with a global filter for example to traslate not refresh the page and global filter not work. This involves the following changes in the method go
Chages in AppRouter.go
AppRouter.go = function(path, options) { if (this.getAttribute('mode') !== 'pushstate') { // mode = auto or hash path = '#' + path; } if (options && options.replace !== true) { window.history.pushState(null, null, path); } else { window.history.replaceState(null, null, path); } stateChange(this,options && options.refresch); };
Changes in stateChange
// Find the first that matches the current URL and change the active route
function stateChange(router,refresch) {
var url = utilities.parseUrl(window.location.href, router.getAttribute('mode'));
}
This allows call the method go as follows go ('/', {refresch: true}) and thus to make the cycle is complete page