diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-07-11 01:29:37 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-07-11 01:29:37 +0200 |
| commit | 52531fbc8d3531a7941ad9c6c79a1e353d35f2fa (patch) | |
| tree | 149636a7fee2870f08578d6600abeb176799c789 /frontend/site | |
| parent | 91e8fdb99e321496c54288fe5a3db6397c768c10 (diff) | |
output redirect
Diffstat (limited to 'frontend/site')
| -rw-r--r-- | frontend/site/site/site.actions.js | 3 | ||||
| -rw-r--r-- | frontend/site/site/site.reducer.js | 8 | ||||
| -rw-r--r-- | frontend/site/viewer/viewer.container.js | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/frontend/site/site/site.actions.js b/frontend/site/site/site.actions.js index 1d92de1..2362e5f 100644 --- a/frontend/site/site/site.actions.js +++ b/frontend/site/site/site.actions.js @@ -17,7 +17,8 @@ export const loadSite = (graph_name, path_name) => dispatch => ( // console.log(graph.home_page) const first_path = ["", graph_name, path_name].join("/") if (!path_name || !(first_path in graph.pages)) { - setTimeout(() => history.push(graph.home_page), 10) + // console.log(graph.home_page) + window.location.href = graph.home_page } }) ) diff --git a/frontend/site/site/site.reducer.js b/frontend/site/site/site.reducer.js index 4975089..f630b9c 100644 --- a/frontend/site/site/site.reducer.js +++ b/frontend/site/site/site.reducer.js @@ -23,6 +23,14 @@ export default function siteReducer(state = initialState, action) { graph: action.data.graph, } + case '@@router/LOCATION_CHANGE': + return { + ...state, + graph: { + ...state.graph, + } + } + default: return state } diff --git a/frontend/site/viewer/viewer.container.js b/frontend/site/viewer/viewer.container.js index e0a0079..68088d2 100644 --- a/frontend/site/viewer/viewer.container.js +++ b/frontend/site/viewer/viewer.container.js @@ -21,7 +21,7 @@ class ViewerContainer extends Component { } componentDidUpdate(prevProps) { - console.log('didUpdate', this.props.graph !== prevProps.graph, this.props.location.pathname !== prevProps.location.pathname) + // console.log('didUpdate', this.props.graph !== prevProps.graph, this.props.location.pathname !== prevProps.location.pathname) if (this.props.graph !== prevProps.graph || this.props.location.pathname !== prevProps.location.pathname) { this.load() } |
