diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx index 5e00ef5a2d..c0de58e814 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx @@ -14,12 +14,10 @@ import Hanger from "./Hanger"; import Question from "./Question"; const ExternalPortal: React.FC = (props) => { - const [copyNode, addExternalPortal] = useStore((state) => [ - state.copyNode, - state.addExternalPortal, - ]); const [href, setHref] = useState("Loading..."); + const addExternalPortal = useStore.getState().addExternalPortal; + const { data, loading } = useQuery( gql` query GetExternalPortal($id: uuid!) { @@ -77,12 +75,6 @@ const ExternalPortal: React.FC = (props) => { ); } - const handleContext = (e: React.MouseEvent) => { - e.preventDefault(); - e.stopPropagation(); - copyNode(props.id); - }; - let editHref = `${window.location.pathname}/nodes/${props.id}/edit`; if (parent) { editHref = `${window.location.pathname}/nodes/${parent}/nodes/${props.id}/edit`; @@ -91,10 +83,7 @@ const ExternalPortal: React.FC = (props) => { return ( <>