diff --git a/apps/dashboard/.eslintrc.js b/apps/dashboard/.eslintrc.js
index 65a8b931ebf..6cdff17ef4e 100644
--- a/apps/dashboard/.eslintrc.js
+++ b/apps/dashboard/.eslintrc.js
@@ -34,6 +34,11 @@ module.exports = {
message:
"Use useV5DashboardChain instead if you are using it inside a component",
},
+ {
+ selector: "CallExpression[callee.name='resolveScheme']",
+ message:
+ "resolveScheme can throw error if resolution fails. Either catch the error and ignore the lint warning or Use `resolveSchemeWithErrorHandler` / `replaceIpfsUrl` utility in dashboard instead",
+ },
],
"no-restricted-imports": [
"error",
diff --git a/apps/dashboard/src/@/components/blocks/wallet-address.tsx b/apps/dashboard/src/@/components/blocks/wallet-address.tsx
index 581fd87be99..bee1e2611b7 100644
--- a/apps/dashboard/src/@/components/blocks/wallet-address.tsx
+++ b/apps/dashboard/src/@/components/blocks/wallet-address.tsx
@@ -1,5 +1,4 @@
"use client";
-
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import {
HoverCard,
@@ -7,6 +6,7 @@ import {
HoverCardTrigger,
} from "@/components/ui/hover-card";
import { useThirdwebClient } from "@/constants/thirdweb.client";
+import { resolveSchemeWithErrorHandler } from "@/lib/resolveSchemeWithErrorHandler";
import { useClipboard } from "hooks/useClipboard";
import { Check, Copy, ExternalLinkIcon } from "lucide-react";
import { useMemo } from "react";
@@ -18,7 +18,6 @@ import {
type SocialProfile,
useSocialProfiles,
} from "thirdweb/react";
-import { resolveScheme } from "thirdweb/storage";
import { cn } from "../../lib/utils";
import { Badge } from "../ui/badge";
import { Button } from "../ui/button";
@@ -113,22 +112,20 @@ export function WalletAddress(props: {
) : !profiles.data?.length ? (
No profiles found
) : (
- profiles.data?.map((profile) => (
-
- {profile.avatar &&
- (profile.avatar.startsWith("http") ||
- profile.avatar?.startsWith("ipfs")) && (
+ profiles.data?.map((profile) => {
+ const walletAvatarLink = resolveSchemeWithErrorHandler({
+ client: thirdwebClient,
+ uri: profile.avatar,
+ });
+
+ return (
+
+ {walletAvatarLink && (
-
+
{profile.name && (
{profile.name.slice(0, 2)}
@@ -136,19 +133,20 @@ export function WalletAddress(props: {
)}
)}
-
-
-
{profile.name}
-
{profile.type}
+
+
+
{profile.name}
+ {profile.type}
+
+ {profile.bio && (
+
+ {profile.bio}
+
+ )}
- {profile.bio && (
-
- {profile.bio}
-
- )}
-
- ))
+ );
+ })
)}