diff --git a/editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx b/editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx index 2b388b3fac..90e50667c2 100644 --- a/editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx +++ b/editor.planx.uk/src/@planx/components/shared/Preview/NavigateToPublishedButton.tsx @@ -1,18 +1,24 @@ import Link from "@mui/material/Link"; import Typography from "@mui/material/Typography"; +import { clearLocalFlow } from "lib/local"; +import { useStore } from "pages/FlowEditor/lib/store"; import React from "react"; import { useNavigation } from "react-navi"; const NavigateToPublishedButton: React.FC = () => { const { navigate } = useNavigation(); + const id = useStore().id; + const handleClick = () => { - navigate("published"); + clearLocalFlow(id); + navigate("published?analytics=false"); + window.location.reload(); }; return ( - Go to the live service + Go to the published version of this service );