fix: replying to self

zio/stable
patak 2022-12-29 14:11:05 +01:00
parent 7c594c68f7
commit b81ca280e5
1 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,8 @@ const { status } = defineProps<{
status: Status status: Status
}>() }>()
const account = useAccountById(status.inReplyToAccountId) const isSelf = $computed(() => status.inReplyToAccountId === status.account.id)
const account = isSelf ? computed(() => status.account) : useAccountById(status.inReplyToAccountId)
</script> </script>
<template> <template>
@ -17,7 +18,7 @@ const account = useAccountById(status.inReplyToAccountId)
:title="account ? `Replying to ${getDisplayName(account)}` : 'Replying to someone'" :title="account ? `Replying to ${getDisplayName(account)}` : 'Replying to someone'"
> >
<div i-ri:reply-fill class="scale-x-[-1]" text-secondary-light /> <div i-ri:reply-fill class="scale-x-[-1]" text-secondary-light />
<template v-if="account?.id !== status.account.id"> <template v-if="!isSelf">
<AccountInlineInfo v-if="account" :account="account" :link="false" /> <AccountInlineInfo v-if="account" :account="account" :link="false" />
<span v-else ws-nowrap>{{ $t('status.someone') }}</span> <span v-else ws-nowrap>{{ $t('status.someone') }}</span>
</template> </template>