fix non-notifying mentions and original mention display

This commit is contained in:
Henry Jameson 2021-06-22 20:16:26 +03:00
parent c6831a3810
commit a258182522
4 changed files with 28 additions and 4 deletions

View file

@ -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