Fix quote rendering error

This commit is contained in:
silverpill 2022-10-04 23:19:46 +00:00
parent 8d9dbad935
commit e4082177dc

View file

@ -74,7 +74,7 @@
<div class="quote-header">
<avatar :profile="post.quote.account"></avatar>
<span class="display-name">
{{ (new ProfileWrapper(post.quote.account)).getDisplayName() }}
{{ getQuoteAuthorDisplayName() }}
</span>
<span class="actor-address">
@{{ getActorAddress(post.quote.account) }}
@ -328,6 +328,14 @@ function getReplyMentions(): Mention[] {
return props.post.mentions
}
function getQuoteAuthorDisplayName(): string | null {
if (props.post.quote === null) {
return null
}
const profile = new ProfileWrapper(props.post.quote.account)
return profile.getDisplayName()
}
function canReply(): boolean {
return currentUser !== null
}