Skip to content

Commit

Permalink
Merge pull request #301 from ubiquity/revert-300-development
Browse files Browse the repository at this point in the history
Revert "View claim"
  • Loading branch information
0x4007 authored Sep 12, 2024
2 parents a06084c + 0057c11 commit b32868b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"URLSAFE",
"WXDAI",
"XDAI",
"xmark",
"outfile"
"xmark"
],
"dictionaries": ["typescript", "node", "software-terms", "html"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/sync-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Sync branch to template
on:
workflow_dispatch:
schedule:
- cron: "14 0 1 * *"
- cron: '14 0 1 * *'

jobs:
sync:
Expand All @@ -23,7 +23,7 @@ jobs:
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Sync branch to template
env:
GH_TOKEN: ${{ steps.get_installation_token.outputs.token }}
Expand All @@ -45,3 +45,5 @@ jobs:
git commit -m "chore: sync template"
git push "$original_remote" "$pr_branch"
gh pr create --title "Sync branch to template" --body "This pull request merges changes from the template repository." --head "$pr_branch" --base "$branch_name"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"@commitlint/config-conventional"
]
}
}
}
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,8 +100,14 @@ 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 @@ -134,15 +140,9 @@ export function claimErc20PermitHandlerWrapper(app: AppState) {
const permit2Contract = new ethers.Contract(permit2Address, permit2Abi, signer);
if (!permit2Contract) return;

const tx: TransactionResponse = await transferFromPermit(permit2Contract, app);
const tx = 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 b32868b

Please sign in to comment.