Skip to content

Commit

Permalink
fix: show explorer URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
rndquu committed Oct 16, 2024
1 parent 93e6dd8 commit e1d502a
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 e1d502a

Please sign in to comment.