Skip to content

Commit

Permalink
squash to reset
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelae committed Oct 9, 2024
1 parent 804a9f0 commit fde8fa9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ui/pages/bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,11 @@ const CrossChainSwap = () => {
}, [isBridgeChain, isBridgeEnabled, providerConfig]);

useEffect(() => {
// Reset controller before unloading the page
const onBeforeUnload = () => {
// Reset controller and inputs before unloading the page
return () => {
dispatch(resetInputFields());
dispatch(resetBridgeState());
};

window.addEventListener('beforeunload', onBeforeUnload);
return () => {
window.removeEventListener('beforeunload', onBeforeUnload);
};
}, []);

const redirectToDefaultRoute = async () => {
Expand Down

0 comments on commit fde8fa9

Please sign in to comment.