1
0
mirror of https://git.pleroma.social/sjw/pleroma-fe.git synced 2024-12-23 18:25:11 +01:00

proper cachin of headTailLinks, show mentions in notificaitons always

This commit is contained in:
Henry Jameson 2021-06-10 13:01:00 +03:00
parent c6c478f4cf
commit 394fd462dc
7 changed files with 25 additions and 19 deletions

View File

@ -142,7 +142,8 @@ const Status = {
replyProfileLink () {
if (this.isReply) {
const user = this.$store.getters.findUser(this.status.in_reply_to_user_id)
return user && user.statusnet_profile_url
// FIXME Why user not found sometimes???
return user ? user.statusnet_profile_url : 'NOT_FOUND'
}
},
retweet () { return !!this.statusoid.retweeted_status },

View File

@ -217,21 +217,23 @@ $status-margin: 0.75em;
}
}
.reply-to {
& .mentions,
& .reply-to {
position: relative;
}
.reply-to-text {
& .reply-to-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.replies-separator {
.mentions-separator {
margin-left: 0.4em;
}
.replies {
margin-top: 0.25em;
line-height: 18px;
font-size: 12px;
display: flex;

View File

@ -267,8 +267,8 @@
:first-mention="false"
/>
<span
v-if="isReply && hasMentions"
class="faint replies-separator"
v-if="isReply && hasMentionsLine"
class="faint mentions-separator"
>
-
</span>
@ -276,7 +276,7 @@
v-if="hasMentionsLine"
>
<span
class="button-unstyled reply-to"
class="button-unstyled mentions"
:aria-label="$t('tool_tip.reply')"
@click.prevent="gotoOriginal(status.in_reply_to_status_id)"
>
@ -285,7 +285,7 @@
icon="at"
/>
<span
class="faint-link reply-to-text"
class="faint-link mentions-text"
>
{{ $t('status.mentions') }}
</span>
@ -304,6 +304,8 @@
:no-heading="noHeading"
:highlight="highlight"
:focused="isFocused"
:hide-first-mentions="mentionsOwnLine"
:head-tail-links="headTailLinks"
@mediaplay="addMediaPlaying($event)"
@mediapause="removeMediaPlaying($event)"
/>

View File

@ -29,14 +29,18 @@ const StatusContent = {
'singleLine',
// if this was computed at upper level it can be passed here, otherwise
// it will be in this component
'headTailLinks'
'headTailLinks',
'hideFirstMentions'
],
data () {
return {
showingTall: this.fullContent || (this.inConversation && this.focused),
showingLongSubject: false,
// not as computed because it sets the initial state which will be changed later
expandingSubject: !this.$store.getters.mergedConfig.collapseMessageWithSubject
expandingSubject: !this.$store.getters.mergedConfig.collapseMessageWithSubject,
headTailLinksComputed: this.headTailLinks
? this.headTailLinks
: getHeadTailLinks(this.status.raw_html)
}
},
computed: {
@ -76,13 +80,6 @@ const StatusContent = {
attachmentTypes () {
return this.status.attachments.map(file => fileType.fileType(file.mimetype))
},
mentionsOwnLine () {
return this.mergedConfig.mentionsOwnLine
},
headTailLinksComputed () {
if (this.headTailLinks) return this.headTailLinks
return getHeadTailLinks(this.status.raw_html)
},
mentions () {
return this.headTailLinksComputed.firstMentions
},

View File

@ -52,7 +52,7 @@
>
<template v-slot:prefix>
<MentionsLine
v-if="!mentionsOwnLine"
v-if="!hideFirstMentions"
:mentions="mentions"
class="mentions-line"
/>

View File

@ -31,7 +31,9 @@ const StatusContent = {
'focused',
'noHeading',
'fullContent',
'singleLine'
'singleLine',
'hideFirstMentions',
'headTailLinks'
],
computed: {
hideAttachments () {

View File

@ -4,6 +4,8 @@
<StatusBody
:status="status"
:single-line="singleLine"
:hide-first-mentions="hideFirstMentions"
:headTailLinks="headTailLinks"
>
<div v-if="status.poll && status.poll.options">
<poll :base-poll="status.poll" />