Skip to content

Commit

Permalink
Merge pull request #341 from rndquu/fix/explorer-addresses
Browse files Browse the repository at this point in the history
fix: show explorer URLs
  • Loading branch information
0x4007 authored Oct 16, 2024
2 parents 93e6dd8 + e1d502a commit 1aa7c57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions static/scripts/rewards/app-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ export class AppState {
}

get currentExplorerUrl(): string {
if (!this.reward) {
if (!this.reward || !networkExplorers[this.reward.networkId]) {
return "https://blockscan.com";
}
return networkExplorers[this.reward.networkId] || "https://blockscan.com";

return networkExplorers[this.reward.networkId][0].url;
}

nextPermit(): Permit | null {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ERC20Permit, Permit, TokenType } from "@ubiquibot/permit-generation/types";
import { networkExplorers } from "@ubiquity-dao/rpc-handler";
import { app } from "../app-state";
import { buttonController, getMakeClaimButton, viewClaimButton } from "../button-controller";
import { claimErc20PermitHandlerWrapper, fetchTreasury } from "../web3/erc20-permit";
Expand Down Expand Up @@ -36,7 +35,7 @@ export async function renderTransaction(): Promise<Success> {
tokenAddress: app.reward.tokenAddress,
ownerAddress: app.reward.owner,
amount: app.reward.amount,
explorerUrl: networkExplorers[app.reward.networkId],
explorerUrl: app.currentExplorerUrl,
table,
requestedAmountElement,
}).catch(console.error);
Expand All @@ -58,7 +57,7 @@ export async function renderTransaction(): Promise<Success> {
table.setAttribute(`data-additional-data-size`, "large");
renderNftSymbol({
tokenAddress: app.reward.tokenAddress,
explorerUrl: networkExplorers[app.reward.networkId],
explorerUrl: app.currentExplorerUrl,
table,
requestedAmountElement,
}).catch(console.error);
Expand Down

0 comments on commit 1aa7c57

Please sign in to comment.