From a258182522e85c31fe9dfbfbddf7a314ca36d0ca Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 22 Jun 2021 20:16:26 +0300 Subject: fix non-notifying mentions and original mention display --- src/components/status_body/status_body.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/components/status_body/status_body.js') diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 601c963b..d1736ba3 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -85,6 +85,20 @@ const StatusContent = { }) }, methods: { + onParseReady (event) { + this.$emit('parseReady', event) + const { writtenMentions } = event + writtenMentions + .filter(mention => !mention.notifying) + .forEach(mention => { + const { content, url } = mention + const cleanedString = content.replace(/<[^>]+?>/gi, '') // remove all tags + if (!cleanedString.startsWith('@')) return + const handle = cleanedString.slice(1) + const host = url.replace(/^https?:\/\//, '').replace(/\/.+?$/, '') + this.$store.dispatch('fetchUserIfMissing', `${handle}@${host}`) + }) + }, toggleShowMore () { if (this.mightHideBecauseTall) { this.showingTall = !this.showingTall -- cgit v1.2.3-70-g09d2