From 11fc2572d51f706aa856a2d0353449b70857bd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 14 Jan 2023 03:01:24 +0800 Subject: [PATCH] refactor: extract check self account --- components/account/AccountFollowButton.vue | 2 +- components/account/AccountHeader.vue | 2 +- components/account/AccountMoreButton.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/account/AccountFollowButton.vue b/components/account/AccountFollowButton.vue index 7b79778e..d109fe0f 100644 --- a/components/account/AccountFollowButton.vue +++ b/components/account/AccountFollowButton.vue @@ -8,7 +8,7 @@ const { account, command, context, ...props } = defineProps<{ command?: boolean }>() -const isSelf = $computed(() => currentUser.value?.account.id === account.id) +const isSelf = useSelfAccount(() => account) const enable = $computed(() => !isSelf && currentUser.value) const relationship = $computed(() => props.relationship || useRelationship(account).value) diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue index cddc3c3b..c9760eb3 100644 --- a/components/account/AccountHeader.vue +++ b/components/account/AccountHeader.vue @@ -75,7 +75,7 @@ watchEffect(() => { iconFields.value = icons }) -const isSelf = $computed(() => currentUser.value?.account.id === account.id) +const isSelf = useSelfAccount(() => account)