refactor: extract check self account

zio/stable
三咲智子 Kevin Deng 2023-01-14 03:01:24 +08:00
parent b6c916517c
commit 11fc2572d5
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
3 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ const { account, command, context, ...props } = defineProps<{
command?: boolean command?: boolean
}>() }>()
const isSelf = $computed(() => currentUser.value?.account.id === account.id) const isSelf = useSelfAccount(() => account)
const enable = $computed(() => !isSelf && currentUser.value) const enable = $computed(() => !isSelf && currentUser.value)
const relationship = $computed(() => props.relationship || useRelationship(account).value) const relationship = $computed(() => props.relationship || useRelationship(account).value)

View File

@ -75,7 +75,7 @@ watchEffect(() => {
iconFields.value = icons iconFields.value = icons
}) })
const isSelf = $computed(() => currentUser.value?.account.id === account.id) const isSelf = useSelfAccount(() => account)
</script> </script>
<template> <template>

View File

@ -7,7 +7,7 @@ const { account } = defineProps<{
}>() }>()
let relationship = $(useRelationship(account)) let relationship = $(useRelationship(account))
const isSelf = $computed(() => currentUser.value?.account.id === account.id) const isSelf = $(useSelfAccount(() => account))
const masto = useMasto() const masto = useMasto()
const toggleMute = async () => { const toggleMute = async () => {