Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
serg-plusplus committed Feb 13, 2024
1 parent 808eaf0 commit 2d3f59b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/app/components/elements/WalletAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ const WalletAvatar: FC<WalletAvatarProps> = memo(({ seed, className }) => {
return ethereumAddressRegex.test(seed);
};

console.log("WALLET AVATAR CHANGE", seed);
const fetchEnsName = async () => {
try {
const name = await getEnsName(seed);
if (name) {
const avatar = await getEnsAvatar(name);
console.log(seed, avatar);
setEnsAvatar(avatar);
} else {
setEnsAvatar(null);
Expand Down
7 changes: 5 additions & 2 deletions src/app/hooks/ens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ const useEns = () => {
const imageUrl = await resolver.getAvatar(ensName, {});

if (imageUrl) {
const imageDataUrl = await toDataURL(imageUrl);

const data = {
imageUrl: await toDataURL(imageUrl),
imageUrl: imageDataUrl,
expirationTimestamp: Date.now() + ONE_DAY,
};

localStorage.setItem(`ENS_AVATAR_${ensName}`, JSON.stringify(data));
return imageUrl;

return imageDataUrl;
} else {
return null;
}
Expand Down

0 comments on commit 2d3f59b

Please sign in to comment.