From a6793f922991d326eeb33cf08b245863218eaef7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 24 Mar 2021 12:27:47 +0100 Subject: fix open page weirdness in a hacky way --- frontend/app/views/graph/graph.actions.js | 5 +++-- frontend/app/views/page/components/page.header.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'frontend/app') diff --git a/frontend/app/views/graph/graph.actions.js b/frontend/app/views/graph/graph.actions.js index 4185386..6d5cb51 100644 --- a/frontend/app/views/graph/graph.actions.js +++ b/frontend/app/views/graph/graph.actions.js @@ -41,10 +41,11 @@ export const setHomePageId = (graph, page) => dispatch => { actions.graph.update(updated_graph) } -export const viewPage = (graph, page) => dispatch => { +export const viewPage = (graph, path) => dispatch => { + // for some reason page.show.res is not always set..?? api(dispatch, types.api, 'export', `/api/v1/graph/export/${graph.path}`) .then(result => { console.log(result) - window.open(`${process.env.EXPORT_HOST}/${graph.path}/${page.path}`) + window.open(`${process.env.EXPORT_HOST}${path}`) }) } diff --git a/frontend/app/views/page/components/page.header.js b/frontend/app/views/page/components/page.header.js index d40f6e0..6df3ee5 100644 --- a/frontend/app/views/page/components/page.header.js +++ b/frontend/app/views/page/components/page.header.js @@ -29,7 +29,7 @@ function PageHeader(props) { - + ) @@ -41,6 +41,7 @@ const mapStateToProps = (state) => ({ graph: state.graph.show.res, page: state.page.show.res, building: state.graph.editor.building, + router: state.router, // isAuthenticated: state.auth.isAuthenticated, }) -- cgit v1.2.3-70-g09d2