Skip to content

Commit bdb27e4

Browse files
fix: Handle NFT fetch failures gracefully and add Treasure chain (#5769)
1 parent 7bc2856 commit bdb27e4

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

apps/wallet-ui/src/components/ConnectButton.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
arbitrum,
66
base,
77
blast,
8+
defineChain,
89
mainnet,
910
optimism,
1011
zkSync,
@@ -19,7 +20,15 @@ export default function ConnectButton({
1920

2021
return (
2122
<ThirdwebConnectButton
22-
chains={[mainnet, base, optimism, arbitrum, blast, zkSync]}
23+
chains={[
24+
mainnet,
25+
base,
26+
optimism,
27+
arbitrum,
28+
blast,
29+
zkSync,
30+
defineChain(61166), // Treasure mainnet
31+
]}
2332
wallets={[ecosystemWallet(ecosystem)]}
2433
client={client}
2534
theme={theme === "light" ? "light" : "dark"}

apps/wallet-ui/src/lib/assets/erc721.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ export async function getErc721Tokens({
6161

6262
if (!response.ok) {
6363
response.body?.cancel();
64-
throw new Error("Failed to fetch NFTs");
64+
console.error("Failed to fetch NFTs");
65+
return {
66+
nextCursor: undefined,
67+
tokens: [],
68+
};
6569
}
6670
const data = await response.json();
6771

apps/wallet-ui/src/util/simplehash.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const chainIdNameMap = [
2626
{ id: 660279, name: "xai", label: "Xai" },
2727
{ id: 324, name: "zksync-era", label: "zkSync Era" },
2828
{ id: 7777777, name: "zora", label: "Zora" },
29+
{ id: 61166, name: "treasure", label: "Treasure" },
2930
];
3031

3132
if (process.env.NEXT_PUBLIC_INCLUDE_TESTNETS) {

0 commit comments

Comments
 (0)