fix profile loading error

This commit is contained in:
tjs 2022-11-12 14:04:52 -05:00
parent 999b7163df
commit 97c353a22a
2 changed files with 7 additions and 8 deletions

View File

@ -136,13 +136,11 @@ export const ConnectWalletButton: React.FC = () => {
{!loadProfileDetails && !isMobile ? (
<div className="ml-2 w-32 text-left">
<p className="mb-0.5 truncate text-xs font-bold capitalize text-th-fgd-1">
{profileDetails.profile_name}
{profileDetails?.profile_name}
</p>
<p className="mb-0 text-xs text-th-fgd-4">
{profileDetails.wallet_pk
? abbreviateAddress(
new PublicKey(profileDetails.wallet_pk)
)
{publicKey
? abbreviateAddress(new PublicKey(publicKey))
: ""}
</p>
</div>

View File

@ -1,5 +1,5 @@
import useMangoStore from 'stores/useMangoStore'
import { ProfileIcon } from './icons'
import useMangoStore from "stores/useMangoStore"
import { ProfileIcon } from "./icons"
const ProfileImage = ({
imageSize,
@ -14,7 +14,8 @@ const ProfileImage = ({
}) => {
const profile = useMangoStore((s) => s.profile.details)
return imageUrl || (isOwnerProfile && profile.profile_image_url) ? (
return imageUrl ||
(profile && isOwnerProfile && profile?.profile_image_url) ? (
<img
alt=""
src={imageUrl ? imageUrl : profile.profile_image_url}