diff --git a/src/views/moderation_log/LogEntryMessage.vue b/src/views/moderation_log/LogEntryMessage.vue index ede85aa2..cf5ab63e 100644 --- a/src/views/moderation_log/LogEntryMessage.vue +++ b/src/views/moderation_log/LogEntryMessage.vue @@ -38,28 +38,16 @@ export default { } }, computed: { - // logEntryMessage() { - // if (!this.actor.nickname) { - // return this.message - // } else { - // return this.message.split(this.actor.nickname).length > 2 - // ? this.message.split(this.actor.nickname)[1].concat(this.actor.nickname) - // : this.message.split(this.actor.nickname)[1] - // } - // }, // logEntryMessageWithoutId() { // return this.logEntryMessage.split(`#${this.subject.id}`) // }, processedHtml() { - const html = this.message.replace(/\@[\S]+/g, ``) + const html = [...this.message.matchAll(/\@(?([\w-]+))/g)].map(res => res.groups.nickname) + .reduce((acc, nickname) => { + return acc.replace(`@${nickname}`, ``) + }, this.message) return { - template: '
' + html + '
', - props: { - actor: { - type: null, - default: () => { return this.actor } - } - } + template: '
' + html + '
' } } } diff --git a/src/views/moderation_log/UserLink.vue b/src/views/moderation_log/UserLink.vue index 11f92128..cacfb1b1 100644 --- a/src/views/moderation_log/UserLink.vue +++ b/src/views/moderation_log/UserLink.vue @@ -1,10 +1,9 @@ @@ -15,14 +14,9 @@ export default { name: 'UserLink', props: { actor: { - type: Object, + type: String, required: true } - }, - methods: { - propertyExists(account, property) { - return account[property] - } } }