Skip to content

Commit

Permalink
fix: fix stamp avatar case sensitiveness (#4893)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Sep 30, 2024
1 parent 1f23609 commit 4a52af5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/AvatarUser.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup lang="ts">
import { getAddress } from '@ethersproject/address';
const props = withDefaults(
defineProps<{
address: string;
Expand All @@ -13,15 +15,23 @@ const props = withDefaults(
const { profilesCreated } = useProfiles();
const normalizedAddress = computed(() => getAddress(props.address));
const timestamp = computed(() => {
if (!props?.address || !profilesCreated.value?.[props.address]) return '';
return `&ts=${profilesCreated.value[props.address]}`;
if (
!normalizedAddress.value ||
!profilesCreated.value?.[normalizedAddress.value]
) {
return '';
}
return `&ts=${profilesCreated.value[normalizedAddress.value]}`;
});
</script>

<template>
<BaseAvatar
:src="`https://cdn.stamp.fyi/avatar/eth:${address}?s=${
:src="`https://cdn.stamp.fyi/avatar/eth:${normalizedAddress}?s=${
Number(size) * 2
}${timestamp}`"
:preview-file="previewFile"
Expand Down

0 comments on commit 4a52af5

Please sign in to comment.