Skip to content

Commit

Permalink
Bridge approval is confirmed move to in progress view (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyounglee authored Jun 20, 2024
1 parent 2043329 commit 1e1bd43
Showing 1 changed file with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,18 @@ export function ApproveTransaction({ bridgeTransaction }: ApproveTransactionProp
provider: from.web3Provider,
transaction: transaction.unsignedTx,
});
viewDispatch({
payload: {
type: ViewActions.UPDATE_VIEW,
view: {
type: BridgeWidgetViews.IN_PROGRESS,
transactionHash: sendResult.transactionResponse.hash,
isTransfer: false,
},
},
});

setLoading(true);
const receipt = await sendResult.transactionResponse.wait();

if (receipt.status === 0) {
viewDispatch({
payload: {
Expand All @@ -256,19 +264,7 @@ export function ApproveTransaction({ bridgeTransaction }: ApproveTransactionProp
},
},
});
return;
}

viewDispatch({
payload: {
type: ViewActions.UPDATE_VIEW,
view: {
type: BridgeWidgetViews.IN_PROGRESS,
transactionHash: receipt.transactionHash,
isTransfer: false,
},
},
});
} catch (error: any) {
if (error.type === CheckoutErrorType.USER_REJECTED_REQUEST_ERROR) {
setRejectedBridge(true);
Expand Down

0 comments on commit 1e1bd43

Please sign in to comment.