Skip to content

Commit

Permalink
feat: support both mainnet and testnet space avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Oct 9, 2024
1 parent 739ece0 commit b58da0c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/AvatarSpace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const props = withDefaults(
}
);
const { env } = useApp();
const avatarHash = computed(() => {
if (!props.space?.avatar) return '';
const hash = sha256(props.space.avatar).slice(0, 16);
Expand All @@ -24,8 +26,8 @@ const avatarHash = computed(() => {
<BaseAvatar
:preview-file="previewFile"
:size="size"
:src="`https://cdn.stamp.fyi/space/${space.id}?s=${
Number(size) * 2
}${avatarHash}`"
:src="`https://cdn.stamp.fyi/space/${env === 'demo' ? 's-tn' : 's'}:${
space.id
}?s=${Number(size) * 2}${avatarHash}`"
/>
</template>

0 comments on commit b58da0c

Please sign in to comment.