Skip to content

Commit

Permalink
reset flow on navigation to published
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Jan 7, 2025
1 parent dda9de1 commit 0203d71
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
<Link onClick={handleClick} component="button">
<Typography variant="body1" textAlign="left">
Go to the live service
Go to the published version of this service
</Typography>
</Link>
);
Expand Down

0 comments on commit 0203d71

Please sign in to comment.