Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Fix URLs redirect to root. (#440)
Browse files Browse the repository at this point in the history
* Fix URLs redirect to root.

* Not just path

* Only use window when available to support prerendering.

* Fix window check
  • Loading branch information
chokoswitch authored Aug 9, 2019
1 parent 28d4a01 commit 027095d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cafe-map/client/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
},
"dependencies": {
"@curiostack/base-web": "0.0.44",
"@curiostack/base-web": "0.0.48",
"@curiostack/cafemap-api": "1.0.0",
"@material-ui/core": "4.2.1",
"@material-ui/icons": "4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion common/web/base-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@storybook/addon-options": "5.1.9",
"@storybook/addon-viewport": "5.1.9",
"@storybook/react": "5.1.9",
"@types/enzyme": "3.10.3",
"@types/history": "4.7.2",
"@types/intl": "1.2.0",
"@types/jest": "24.0.15",
Expand Down Expand Up @@ -137,7 +138,6 @@
"devDependencies": {
"@types/compression-webpack-plugin": "2.0.1",
"@types/copy-webpack-plugin": "5.0.0",
"@types/enzyme": "3.10.3",
"@types/enzyme-adapter-react-16": "1.0.5",
"@types/eslint": "4.16.6",
"@types/fontfaceobserver": "0.0.6",
Expand Down
4 changes: 3 additions & 1 deletion common/web/base-web/src/state/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ import { InjectableStore } from './store';
export interface RouterStateRecord extends Record<RouterState>, RouterState {}

export const routeInitialState: RouterStateRecord = Record<RouterState>({
location: createLocation(''),
location: createLocation(
typeof window !== 'undefined' ? window.location : '',
),
action: 'POP',
})();

Expand Down
2 changes: 1 addition & 1 deletion eggworld/client/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
},
"dependencies": {
"@curiostack/base-web": "0.0.44",
"@curiostack/base-web": "0.0.48",
"@curiostack/eggworld-api": "1.0.0",
"howler": "2.1.2",
"konva": "3.3.2",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@babel/runtime-corejs2": "7.5.5",
"@babel/runtime-corejs3": "7.5.5",
"@curiostack/base-node-dev": "0.0.16",
"@curiostack/base-web": "0.0.47",
"@curiostack/base-web": "0.0.48",
"@curiostack/eslint-config-web": "0.0.2",
"@gfx/zopfli": "1.0.14",
"@hugmanrique/react-markdown-loader": "0.0.2",
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@
typescript "3.5.3"

"@curiostack/base-web@0.0.44":
version "0.0.47"
version "0.0.48"
dependencies:
"@babel/core" "7.5.5"
"@babel/plugin-proposal-async-generator-functions" "7.2.0"
Expand All @@ -912,6 +912,7 @@
"@storybook/addon-options" "5.1.9"
"@storybook/addon-viewport" "5.1.9"
"@storybook/react" "5.1.9"
"@types/enzyme" "3.10.3"
"@types/history" "4.7.2"
"@types/intl" "1.2.0"
"@types/jest" "24.0.15"
Expand Down

0 comments on commit 027095d

Please sign in to comment.