Skip to content

Commit

Permalink
fix: Handle NFT fetch failures gracefully and add Treasure chain
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquim-verges committed Dec 17, 2024
1 parent 7bc2856 commit ea23046
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion apps/wallet-ui/src/components/ConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
arbitrum,
base,
blast,
defineChain,
mainnet,
optimism,
zkSync,
Expand All @@ -19,7 +20,15 @@ export default function ConnectButton({

return (
<ThirdwebConnectButton
chains={[mainnet, base, optimism, arbitrum, blast, zkSync]}
chains={[
mainnet,
base,
optimism,
arbitrum,
blast,
zkSync,
defineChain(61166), // Treasure mainnet
]}
wallets={[ecosystemWallet(ecosystem)]}
client={client}
theme={theme === "light" ? "light" : "dark"}
Expand Down
6 changes: 5 additions & 1 deletion apps/wallet-ui/src/lib/assets/erc721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ export async function getErc721Tokens({

if (!response.ok) {
response.body?.cancel();
throw new Error("Failed to fetch NFTs");
console.error("Failed to fetch NFTs");
return {
nextCursor: undefined,
tokens: [],
};
}
const data = await response.json();

Expand Down
1 change: 1 addition & 0 deletions apps/wallet-ui/src/util/simplehash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const chainIdNameMap = [
{ id: 660279, name: "xai", label: "Xai" },
{ id: 324, name: "zksync-era", label: "zkSync Era" },
{ id: 7777777, name: "zora", label: "Zora" },
{ id: 61166, name: "treasure", label: "Treasure" },
];

if (process.env.NEXT_PUBLIC_INCLUDE_TESTNETS) {
Expand Down

0 comments on commit ea23046

Please sign in to comment.