logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 394fd462dc48654ba7743bb9c2ac378f98f75bd4
parent c6c478f4cf123d9510e1e67a852cad0398d08052
Author: Henry Jameson <me@hjkos.com>
Date:   Thu, 10 Jun 2021 13:01:00 +0300

proper cachin of headTailLinks, show mentions in notificaitons always

Diffstat:

Msrc/components/status/status.js3++-
Msrc/components/status/status.scss8+++++---
Msrc/components/status/status.vue10++++++----
Msrc/components/status_body/status_body.js15++++++---------
Msrc/components/status_body/status_body.vue2+-
Msrc/components/status_content/status_content.js4+++-
Msrc/components/status_content/status_content.vue2++
7 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/src/components/status/status.js b/src/components/status/status.js @@ -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 }, diff --git a/src/components/status/status.scss b/src/components/status/status.scss @@ -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; diff --git a/src/components/status/status.vue b/src/components/status/status.vue @@ -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)" /> diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js @@ -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 }, diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue @@ -52,7 +52,7 @@ > <template v-slot:prefix> <MentionsLine - v-if="!mentionsOwnLine" + v-if="!hideFirstMentions" :mentions="mentions" class="mentions-line" /> diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js @@ -31,7 +31,9 @@ const StatusContent = { 'focused', 'noHeading', 'fullContent', - 'singleLine' + 'singleLine', + 'hideFirstMentions', + 'headTailLinks' ], computed: { hideAttachments () { diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue @@ -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" />