Fix deleted comments crashing the discussions

Closes #753

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-07-02 10:04:14 +02:00
parent b196719238
commit 63d0703b95
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 13 additions and 3 deletions

View File

@ -1,14 +1,20 @@
<template>
<article class="comment">
<div class="avatar">
<figure class="image is-48x48" v-if="comment.actor.avatar">
<figure
class="image is-48x48"
v-if="comment.actor && comment.actor.avatar"
>
<img class="is-rounded" :src="comment.actor.avatar.url" alt="" />
</figure>
<b-icon v-else size="is-large" icon="account-circle" />
</div>
<div class="body">
<div class="meta">
<span class="first-line name" v-if="!comment.deletedAt">
<span
class="first-line name"
v-if="comment.actor && !comment.deletedAt"
>
<strong>{{ comment.actor.name }}</strong>
<small>@{{ usernameWithDomain(comment.actor) }}</small>
</span>
@ -17,7 +23,11 @@
</span>
<span
class="icons"
v-if="!comment.deletedAt && comment.actor.id === currentActor.id"
v-if="
comment.actor &&
!comment.deletedAt &&
comment.actor.id === currentActor.id
"
>
<b-dropdown aria-role="list">
<b-icon slot="trigger" role="button" icon="dots-horizontal" />