From 864b0190df351df708607532c12bf023b7a22502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Tue, 29 Oct 2024 09:23:34 +0000 Subject: [PATCH] fix: Persist portal state behind node modal (#3863) --- editor.planx.uk/src/pages/FlowEditor/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/index.tsx b/editor.planx.uk/src/pages/FlowEditor/index.tsx index 4b3275d835..90c32cae45 100644 --- a/editor.planx.uk/src/pages/FlowEditor/index.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/index.tsx @@ -5,7 +5,7 @@ import ButtonGroup from "@mui/material/ButtonGroup"; import { styled } from "@mui/material/styles"; import { HEADER_HEIGHT_EDITOR } from "components/Header/Header"; import React, { useRef } from "react"; -import { useCurrentRoute } from "react-navi"; +import { rootFlowPath } from "routes/utils"; import Flow from "./components/Flow"; import { ToggleDataFieldsButton } from "./components/FlowEditor/ToggleDataFieldsButton"; @@ -40,8 +40,8 @@ const EditorVisualControls = styled(ButtonGroup)(({ theme }) => ({ })); const FlowEditor = () => { - const [flow, ...breadcrumbs] = - useCurrentRoute().url.pathname.split("/").at(-1)?.split(",") || []; + const flowPath = rootFlowPath(true).split("/")[2]; + const [flow, ...breadcrumbs] = flowPath.split(","); const scrollContainerRef = useRef(null); useScrollControlsAndRememberPosition(scrollContainerRef);