diff --git a/bridge_ui/src/components/NFT/index.tsx b/bridge_ui/src/components/NFT/index.tsx index 7dadb69c7..7ad5be722 100644 --- a/bridge_ui/src/components/NFT/index.tsx +++ b/bridge_ui/src/components/NFT/index.tsx @@ -45,7 +45,8 @@ function NFT() { const isSendComplete = useSelector(selectNFTIsSendComplete); const isRedeeming = useSelector(selectNFTIsRedeeming); const isRedeemComplete = useSelector(selectNFTIsRedeemComplete); - const preventNavigation = isSending || isSendComplete || isRedeeming; + const preventNavigation = + (isSending || isSendComplete || isRedeeming) && !isRedeemComplete; useEffect(() => { if (preventNavigation) { window.onbeforeunload = () => true; diff --git a/bridge_ui/src/components/Transfer/index.tsx b/bridge_ui/src/components/Transfer/index.tsx index be870b507..e91a56945 100644 --- a/bridge_ui/src/components/Transfer/index.tsx +++ b/bridge_ui/src/components/Transfer/index.tsx @@ -47,11 +47,14 @@ function Transfer() { const isSendComplete = useSelector(selectTransferIsSendComplete); const isRedeeming = useSelector(selectTransferIsRedeeming); const isRedeemComplete = useSelector(selectTransferIsRedeemComplete); - const preventNavigation = isSending || isSendComplete || isRedeeming; + const preventNavigation = + (isSending || isSendComplete || isRedeeming) && !isRedeemComplete; useEffect(() => { if (preventNavigation) { + console.log("add onbeforeunload"); window.onbeforeunload = () => true; return () => { + console.log("remove onbeforeunload"); window.onbeforeunload = null; }; }