Skip to content

Commit

Permalink
Cleanup and useLazyAsyncData
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-toth committed Oct 3, 2023
1 parent 68f61ab commit 9b85832
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions components/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
</v-avatar>
</template>

<style>
</style>

<script setup lang="ts">
const props = defineProps<{
address: string,
Expand All @@ -24,6 +19,9 @@ const props = defineProps<{
const abc = useArtByCity()
const size = props.small ? 32 : 128
const avatar = await abc.legacy.fetchAvatar(props.address)
const {
data: avatar
} = useLazyAsyncData(`avatar-${props.address}`, async () => {
return await abc.legacy.fetchAvatar(props.address)
})
</script>
2 changes: 1 addition & 1 deletion pages/[profile]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<v-row>
<v-col lg="2" offset-lg="1">
<v-row class="mt-4" justify="center">
<Avatar :address="data.address" :small="false" />
<Avatar :address="data.address" />
</v-row>
<v-row class="mt-4 mb-1 mx-auto" justify="center">
<template v-if="data.isProfileOfCurrentUser">
Expand Down

0 comments on commit 9b85832

Please sign in to comment.