Skip to content

Commit

Permalink
fix: two more errors on avatar and drodownmenu for defensive code mis…
Browse files Browse the repository at this point in the history
…sing
  • Loading branch information
VanessaPC committed May 17, 2024
1 parent 9a0f11f commit db27d51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export const DropdownMenu = ({ isPopup }: DropdownMenuProps): React.ReactElement
placement="bottomRight"
trigger={['click']}
>
{process.env.USE_MULTI_WALLET === 'true' ? (
{process.env.USE_MULTI_WALLET === 'true' && walletName ? (
<div className={styles.profileDropdownTrigger}>
<ProfileDropdown.Trigger
title={addEllipsis(walletName, titleCharBeforeEll, titleCharAfterEll)}
subtitle={getActiveWalletSubtitle(cardanoWallet.source.account)}
subtitle={getActiveWalletSubtitle(cardanoWallet?.source.account)}
active={isDropdownMenuOpen}
profile={
activeWalletAvatar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const UserAvatar = ({ walletName, isPopup, avatar }: UserAvatarProps): Re
{avatar ? (
<Image src={avatar} className={styles.userAvatarImage} preview={false} />
) : (
<span>{walletName[0]?.toUpperCase()}</span>
<span>{walletName && walletName[0]?.toUpperCase()}</span>
)}
</div>
);

0 comments on commit db27d51

Please sign in to comment.