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 () { replyProfileLink () {
if (this.isReply) { if (this.isReply) {
const user = this.$store.getters.findUser(this.status.in_reply_to_user_id) 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 }, retweet () { return !!this.statusoid.retweeted_status },

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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