fix: don't show follow when self profile

zio/stable
三咲智子 2022-11-23 21:59:13 +08:00
parent ca0672390c
commit 8a43cfaca5
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ const { account } = defineProps<{
account: Account account: Account
}>() }>()
const isSelf = $computed(() => currentUser.value?.account?.id === account.id)
const relationship = $(useRelationship(account)) const relationship = $(useRelationship(account))
async function toggleFollow() { async function toggleFollow() {
@ -14,7 +15,11 @@ async function toggleFollow() {
</script> </script>
<template> <template>
<button v-if="relationship" flex gap-1 items-center w-full rounded hover="op100 text-white b-purple" group @click="toggleFollow"> <button
v-if="!isSelf && relationship"
flex gap-1 items-center w-full rounded hover="op100 text-white b-purple" group
@click="toggleFollow"
>
<div rounded w-28 p2 :group-hover="relationship?.following ? 'bg-red/30' : 'bg-purple/30'" :class="!relationship?.following ? 'bg-cyan/10' : ' bg-purple/10'"> <div rounded w-28 p2 :group-hover="relationship?.following ? 'bg-red/30' : 'bg-purple/30'" :class="!relationship?.following ? 'bg-cyan/10' : ' bg-purple/10'">
<template v-if="relationship?.following"> <template v-if="relationship?.following">
<span group-hover="hidden">Following</span> <span group-hover="hidden">Following</span>