forked from AkkomaGang/akkoma-fe
switch from method to computed property
This commit is contained in:
parent
f6600a35a5
commit
0f824ff311
2 changed files with 4 additions and 8 deletions
|
@ -274,6 +274,9 @@ const Status = {
|
||||||
},
|
},
|
||||||
ownStatus () {
|
ownStatus () {
|
||||||
return this.status.user.id === this.$store.state.users.currentUser.id
|
return this.status.user.id === this.$store.state.users.currentUser.id
|
||||||
|
},
|
||||||
|
tags () {
|
||||||
|
return this.status.tags.filter(tagObj => tagObj.hasOwnProperty('name')).map(tagObj => tagObj.name).join(' ')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -289,13 +292,6 @@ const Status = {
|
||||||
AvatarList
|
AvatarList
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
generateTagAttributes (tags) {
|
|
||||||
let res = {}
|
|
||||||
for (let tag of tags) {
|
|
||||||
res['data-tag-' + tag.name] = tag.name
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
},
|
|
||||||
visibilityIcon (visibility) {
|
visibilityIcon (visibility) {
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case 'private':
|
case 'private':
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status" v-bind="generateTagAttributes(status.tags)">
|
<div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status" :data-tags="tags">
|
||||||
<div v-if="!noHeading" class="media-left">
|
<div v-if="!noHeading" class="media-left">
|
||||||
<router-link :to="userProfileLink" @click.stop.prevent.capture.native="toggleUserExpanded">
|
<router-link :to="userProfileLink" @click.stop.prevent.capture.native="toggleUserExpanded">
|
||||||
<UserAvatar :compact="compact" :betterShadow="betterShadow" :user="status.user"/>
|
<UserAvatar :compact="compact" :betterShadow="betterShadow" :user="status.user"/>
|
||||||
|
|
Loading…
Reference in a new issue