File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -399,10 +399,16 @@ const { user } = useAtproto()
399399
400400const authModal = useModal (' auth-modal' )
401401
402- const { data : likesData } = useFetch (() => ` /api/social/likes/${packageName .value } ` , {
403- default : () => ({ totalLikes: 0 , userHasLiked: false }),
404- server: false ,
405- })
402+ const { data : likesData, status : likeStatus } = useFetch (
403+ () => ` /api/social/likes/${packageName .value } ` ,
404+ {
405+ default : () => ({ totalLikes: 0 , userHasLiked: false }),
406+ server: false ,
407+ },
408+ )
409+ const isLoadingLikeData = computed (
410+ () => likeStatus .value !== ' error' && likeStatus .value !== ' success' ,
411+ )
406412
407413const isLikeActionPending = ref (false )
408414
@@ -609,8 +615,15 @@ onKeyStroke(
609615 likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
610616 "
611617 position =" bottom"
618+ class =" items-center"
612619 >
620+ <span
621+ v-if =" isLoadingLikeData"
622+ class =" i-carbon-circle-dash w-3 h-3 motion-safe:animate-spin"
623+ aria-hidden =" true"
624+ />
613625 <button
626+ v-else
614627 @click =" likeAction"
615628 type =" button"
616629 :title ="
You can’t perform that action at this time.
0 commit comments