@@ -4,20 +4,11 @@ import { updateProfile as updateProfileUtil } from '~/utils/atproto/profile'
44const route = useRoute (' profile-handle' )
55const handle = computed (() => route .params .handle )
66
7- const {
8- data : profile,
9- status : profileStatus,
10- error : profileError,
11- } = await useFetch <NPMXProfile >(() => ` /api/social/profile/${handle .value } ` , {
7+ const { data : profile } = await useFetch <NPMXProfile >(() => ` /api/social/profile/${handle .value } ` , {
128 default : () => ({ displayName: handle .value , description: ' ' , website: ' ' }),
139})
1410
15- if (
16- profileStatus .value === ' error' &&
17- profileError .value ?.statusCode &&
18- profileError .value .statusCode >= 400 &&
19- profileError .value .statusCode < 500
20- ) {
11+ if (! profile .value ) {
2112 throw createError ({
2213 statusCode: 404 ,
2314 statusMessage: $t (' profile.not_found' ),
@@ -77,7 +68,7 @@ async function updateProfile() {
7768 }
7869}
7970
80- const { data : likesData, status } = await useProfileLikes (handle )
71+ const { data : likesData, status } = useProfileLikes (handle )
8172
8273useSeoMeta ({
8374 title : () => $t (' profile.seo_title' , { handle: handle .value }),
@@ -178,8 +169,8 @@ defineOgImageComponent('Default', {
178169 {{ $t('profile.likes') }}
179170 <span v-if =" likesData" >({{ likesData.likes?.records?.length ?? 0 }})</span >
180171 </h2 >
181- <div v-if =" status === 'pending'" >
182- <p >{{ $t('common.loading') }}</ p >
172+ <div v-if =" status === 'pending'" class = " grid grid-cols-1 lg:grid-cols-2 gap-4 " >
173+ <SkeletonBlock v-for = " i in 4 " :key = " i " class = " h-16 rounded-lg " / >
183174 </div >
184175 <div v-else-if =" status === 'error'" >
185176 <p >{{ $t('common.error') }}</p >
0 commit comments