Skip to content

Commit

Permalink
chore: fix lowercase address cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashshah committed Jun 12, 2024
1 parent 93446d8 commit a62f052
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/ProfilePicHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {CacheHelper} from './CacheHelper';
export const ProfilePicHelper = {
getProfilePicture: async (address: string) => {
try {
const cachedPicture = await CacheHelper.getItem(address);
const cachedPicture = await CacheHelper.getItem(address.toLowerCase());
if (cachedPicture) return cachedPicture;
const response = await user.get({
account: address,
env: envConfig.ENV as Env,
});
const pfp = response?.profile?.picture;
if (pfp) CacheHelper.setItem(address, pfp);
if (pfp) CacheHelper.setItem(address.toLowerCase(), pfp);
return pfp;
} catch {
return null;
Expand Down

0 comments on commit a62f052

Please sign in to comment.