aboutsummaryrefslogtreecommitdiff
path: root/src/components/mention_link
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/mention_link')
-rw-r--r--src/components/mention_link/mention_link.js26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js
index 8ad84a51..acd0f584 100644
--- a/src/components/mention_link/mention_link.js
+++ b/src/components/mention_link/mention_link.js
@@ -6,13 +6,20 @@ const MentionLink = {
name: 'MentionLink',
props: {
url: {
- required: true,
type: String
},
content: {
required: true,
type: String
},
+ userId: {
+ required: false,
+ type: String
+ },
+ userScreenName: {
+ required: false,
+ type: String
+ },
firstMention: {
required: false,
type: Boolean,
@@ -21,29 +28,32 @@ const MentionLink = {
},
methods: {
onClick () {
- const link = generateProfileLink(this.user.id, this.user.screen_name)
+ const link = generateProfileLink(
+ this.userId || this.user.id,
+ this.userScreenName || this.user.screen_name
+ )
this.$router.push(link)
}
},
computed: {
user () {
- return this.$store.getters.findUserByUrl(this.url)
+ return this.url && this.$store.getters.findUserByUrl(this.url)
},
isYou () {
// FIXME why user !== currentUser???
- return this.user.screen_name === this.currentUser.screen_name
+ return this.user && this.user.screen_name === this.currentUser.screen_name
},
userName () {
- return this.userNameFullUi.split('@')[0]
+ return this.user && this.userNameFullUi.split('@')[0]
},
userNameFull () {
- return this.user.screen_name
+ return this.user && this.user.screen_name
},
userNameFullUi () {
- return this.user.screen_name_ui
+ return this.user && this.user.screen_name_ui
},
highlight () {
- return this.mergedConfig.highlight[this.user.screen_name]
+ return this.user && this.mergedConfig.highlight[this.user.screen_name]
},
highlightType () {
return this.highlight && ('-' + this.highlight.type)