Skip to content

Commit

Permalink
chore: view claim rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Sep 12, 2024
1 parent 2e83e51 commit c146e19
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions static/scripts/rewards/web3/erc20-permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,8 @@ async function transferFromPermit(permit2Contract: Contract, app: AppState) {
async function waitForTransaction(tx: TransactionResponse) {
try {
const receipt = await tx.wait();
viewClaimButton.onclick = () => {
window.open(`https://blockscan.com/tx/${receipt.transactionHash}`, "_blank");
};

toaster.create("success", `Claim Complete.`);
buttonController.showViewClaim();
buttonController.hideLoader();
buttonController.hideMakeClaim();
console.log(receipt.transactionHash);

return receipt;
Expand Down Expand Up @@ -140,9 +134,15 @@ export function claimErc20PermitHandlerWrapper(app: AppState) {
const permit2Contract = new ethers.Contract(permit2Address, permit2Abi, signer);
if (!permit2Contract) return;

const tx = await transferFromPermit(permit2Contract, app);
const tx: TransactionResponse = await transferFromPermit(permit2Contract, app);
if (!tx) return;

viewClaimButton.onclick = () => window.open(`https://blockscan.com/tx/${tx.hash}`, "_blank");

buttonController.showViewClaim();
buttonController.hideLoader();
buttonController.hideMakeClaim();

const receipt = await waitForTransaction(tx);
if (!receipt) return;

Expand Down

0 comments on commit c146e19

Please sign in to comment.