fix: 🐛 collapse reply if type is a mention and it has a reply

This commit is contained in:
ThatOneCalculator 2023-06-22 16:46:18 -07:00
parent d5854c2324
commit 278f42a720
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 18 additions and 12 deletions

View file

@ -16,11 +16,12 @@
:note="appearNote.reply"
class="reply-to"
/>
<div v-if="!detailedView"
<div
v-if="!detailedView"
class="note-context"
@click="noteClick"
:class="{
collapsedReply: collapsedReply && appearNote.reply
:class="{
collapsedReply: collapsedReply && appearNote.reply,
}"
>
<div class="line"></div>
@ -71,7 +72,10 @@
</div>
<div v-if="collapsedReply && appearNote.reply" class="info">
<MkAvatar class="avatar" :user="appearNote.reply.user" />
<MkUserName class="username" :user="appearNote.reply.user"></MkUserName>
<MkUserName
class="username"
:user="appearNote.reply.user"
></MkUserName>
<Mfm
class="summary"
:text="getNoteSummary(appearNote.reply)"
@ -92,10 +96,7 @@
<div class="main">
<div class="header-container">
<MkAvatar class="avatar" :user="appearNote.user" />
<XNoteHeader
class="header"
:note="appearNote"
/>
<XNoteHeader class="header" :note="appearNote" />
</div>
<div class="body">
<MkSubNoteContent
@ -747,14 +748,14 @@ defineExpose({
}
.info {
color: var(--fgTransparentWeak);
transition: color .2s;
transition: color 0.2s;
}
.avatar {
width: 1.2em;
height: 1.2em;
border-radius: 2em;
overflow: hidden;
margin-right: .4em;
margin-right: 0.4em;
background: var(--panelHighlight);
}
.username {
@ -765,7 +766,8 @@ defineExpose({
content: ": ";
}
}
&:hover, &:focus-within {
&:hover,
&:focus-within {
.info {
color: var(--fg);
}

View file

@ -26,7 +26,11 @@
"
:key="notification.id"
:note="notification.note"
:collapsedReply="notification.type === 'reply'"
:collapsedReply="
notification.type === 'reply' ||
(notification.type === 'mention' &&
notification.note.replyId != null)
"
/>
<XNotification
v-else