diff --git a/web/src/pages/SubmitList/NavigationButtons/PreviousButton.tsx b/web/src/pages/SubmitList/NavigationButtons/PreviousButton.tsx index 9621a55..7e54e47 100644 --- a/web/src/pages/SubmitList/NavigationButtons/PreviousButton.tsx +++ b/web/src/pages/SubmitList/NavigationButtons/PreviousButton.tsx @@ -1,7 +1,7 @@ import React from "react"; import styled from "styled-components"; import { Button } from "@kleros/ui-components-library"; -import { useNavigate } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; import { ListProgress, useSubmitListContext } from "context/SubmitListContext"; const StyledButton = styled(Button)<{ prevRoute: string }>` @@ -14,9 +14,15 @@ interface IReturnButton { const ReturnButton: React.FC = ({ prevRoute }) => { const navigate = useNavigate(); + const location = useLocation(); + + const isDeployPage = location.pathname.includes("/deploy"); + const { progress, isSubmittingList } = useSubmitListContext(); + + const hideReturn = isDeployPage && progress === ListProgress.SubmitSuccess; return ( - progress !== ListProgress.SubmitSuccess && ( + !hideReturn && ( navigate(prevRoute)}