Skip to content

Commit

Permalink
Use getChecksum instead of getAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth committed Mar 14, 2024
1 parent ddafac1 commit 42e7144
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/components/member/memberAvatar/memberAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as blockies from 'blockies-ts';
import type React from 'react';
import { getAddress, type Address } from 'viem';
import { type Address } from 'viem';
import { normalize } from 'viem/ens';
import { useEnsAddress, useEnsAvatar, useEnsName } from 'wagmi';
import { Avatar, type IAvatarProps } from '../../../../core';
Expand Down Expand Up @@ -46,7 +46,7 @@ export const MemberAvatar: React.FC<IMemberAvatarProps> = (props) => {
const resolvedAvatarSrc = avatarSrc ?? ensAvatarData ?? undefined;

const blockiesSrc = resolvedAddress
? blockies.create({ seed: getAddress(resolvedAddress), scale: 8, size: 8 }).toDataURL()
? blockies.create({ seed: addressUtils.getChecksum(resolvedAddress), scale: 8, size: 8 }).toDataURL()
: undefined;

const isLoading = avatarLoading || nameLoading || addressLoading;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getAddress } from 'viem';
import { useAccount } from 'wagmi';
import { DataList, Heading, NumberFormat, Tag, formatterUtils, type IDataListItemProps } from '../../../../../core';
import { addressUtils } from '../../../../utils';
Expand Down Expand Up @@ -36,7 +35,7 @@ export const MemberDataListItemStructure: React.FC<IMemberDataListItemProps> = (

const { address: currentUserAddress, isConnected } = useAccount();

const isCurrentUser = isConnected && address && currentUserAddress === getAddress(address);
const isCurrentUser = isConnected && address && currentUserAddress === addressUtils.getChecksum(address);

const resolvedUserHandle = ensName != null && ensName !== '' ? ensName : addressUtils.truncateAddress(address);

Expand Down

0 comments on commit 42e7144

Please sign in to comment.