Skip to content

Commit

Permalink
Feat fetch testnet space avatar from stamp (#4911)
Browse files Browse the repository at this point in the history
* fix: allow space avatar edition on testnet

* feat: support both mainnet and testnet space avatar

---------

Co-authored-by: Chaitanya <[email protected]>
  • Loading branch information
wa0x6e and ChaituVR authored Oct 9, 2024
1 parent 3201bd9 commit 8059733
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 8059733

Please sign in to comment.