Skip to content

Commit

Permalink
πŸ‘¨β€πŸ’» Misc enhancements inspired by #75
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-dimitru committed Jun 8, 2022
1 parent 231b217 commit d405c88
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions client/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class Router {
}

path(_pathDef, fields = {}, _queryParams = {}) {
let pathDef = _pathDef;
let pathDef = _pathDef || '';
let queryParams = _queryParams;

if (this._routesMap[pathDef]) {
Expand Down Expand Up @@ -474,7 +474,7 @@ class Router {
if (!path || (!self.env.reload.get() && self._current.path === path)) {
return;
}
original.call(this, path.replace(/\/\/+/g, '/'), state, dispatch, push);
original.call(self, path.replace(/\/\/+/g, '/'), state, dispatch, push);
};
});

Expand All @@ -484,11 +484,17 @@ class Router {
// we are doing a hack. see .path()
this._page.base(this._basePath);

this._page(Object.assign({
const pageOptions = Object.assign({
click: true,
popstate: true,
// dispatch: false, // not supported by FlowRouter
hashbang: !!options.hashbang,
decodeURLComponents: true
}, options.page || {}));
decodeURLComponents: true,
window: window
}, options.page || {});


this._page.call(void 0, pageOptions);
this._initialized = true;
}

Expand Down

0 comments on commit d405c88

Please sign in to comment.