From 52531fbc8d3531a7941ad9c6c79a1e353d35f2fa Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 11 Jul 2020 01:29:37 +0200 Subject: output redirect --- frontend/site/site/site.actions.js | 3 ++- frontend/site/site/site.reducer.js | 8 ++++++++ frontend/site/viewer/viewer.container.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'frontend/site') 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() } -- cgit v1.2.3-70-g09d2