diff --git a/src/App.tsx b/src/App.tsx index 0486a18..6a6a7e3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,7 +22,6 @@ import Templates from "./components/templates/Templates"; import DocumentCompletionScreen from "./components/process/CompletionScreen/DocumentCompletionScreen"; import JoyrideController from "./utlity/JoyRideTour"; import Contacts from "./components/contacts/Contacts"; - const App = () => { return ( diff --git a/src/components/client/SignCompletionScreen.tsx b/src/components/client/SignCompletionScreen.tsx index 2038f29..31a2d33 100644 --- a/src/components/client/SignCompletionScreen.tsx +++ b/src/components/client/SignCompletionScreen.tsx @@ -17,6 +17,32 @@ const SignCompletionScreen: React.FC = () => { const [showDownloadModal, setShowDownloadModal] = useState(false); const [animationPhase, setAnimationPhase] = useState(0); + + useEffect(() => { + const currentPath = window.location.pathname; + + const handlePopState = (event) => { + // Show warning + // alert("Back navigation is blocked on this screen."); + + // Push the current URL back to prevent navigating away + window.history.pushState(null, "", currentPath); + }; + + // Push extra states to build history buffer + for (let i = 0; i < 50; i++) { + window.history.pushState(null, "", currentPath); + } + + // Add popstate listener + window.addEventListener("popstate", handlePopState); + + // Cleanup on unmount + return () => { + window.removeEventListener("popstate", handlePopState); + }; + }, []); + useEffect(() => { // Trigger animation phases sequentially const timers = [ @@ -321,7 +347,7 @@ const SignCompletionScreen: React.FC = () => { {/* Additional Info */}
- Your document is signed and ready. You can download it or return to the sign made easy. + Your document is signed and saved. Download it or return to Sign Made Easy to continue — navigation is paused until an action is taken.
| {contact.firstName} | {contact.lastName} | @@ -181,7 +181,7 @@ const Contacts = () => { {openMenuId === contact.id && ( -