Skip to content

Commit

Permalink
Fix transfer completion bug in manual transfer claims (#2651)
Browse files Browse the repository at this point in the history
* Fix transfer completion bug in manual transfer claims

When claiming a manual transfer, the useTrackTransfer hook sometimes marked the transfer as complete before the async function triggered by the claim button finished. This allowed users to start a new transfer prematurely, causing the new transfer to be erroneously marked as complete. We should rely solely on the useTrackTransfer hook to set the transfer as complete and handle the redeem transaction.

* move event back
  • Loading branch information
kev1n-peters committed Sep 19, 2024
1 parent 78a5f09 commit 75601d0
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions wormhole-connect/src/views/v2/Redeem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { RouteContext } from 'contexts/RouteContext';
import useTrackTransfer from 'hooks/useTrackTransfer';
import PoweredByIcon from 'icons/PoweredBy';
import { SDKv2Signer } from 'routes/sdkv2/signer';
import { setRedeemTx, setTransferComplete } from 'store/redeem';
import { setRoute } from 'store/router';
import { displayAddress, millisToHumanString } from 'utils';
import { interpretTransferError } from 'utils/errors';
Expand Down Expand Up @@ -483,13 +482,6 @@ const Redeem = () => {
console.error(e);
}
if (txId !== undefined) {
dispatch(setRedeemTx(txId));

// Transfer may require an additional step if this is a finalizable route
if (!routes.isFinalizable(route)) {
dispatch(setTransferComplete(true));
}

config.triggerEvent({
type: 'transfer.redeem.success',
details: transferDetails,
Expand Down

0 comments on commit 75601d0

Please sign in to comment.