aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_card/user_card.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/user_card/user_card.js')
-rw-r--r--src/components/user_card/user_card.js28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index 7c6ffa89..e019ebbd 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -1,5 +1,6 @@
import UserAvatar from '../user_avatar/user_avatar.vue'
import RemoteFollow from '../remote_follow/remote_follow.vue'
+import ProgressButton from '../progress_button/progress_button.vue'
import ModerationTools from '../moderation_tools/moderation_tools.vue'
import { hex2rgb } from '../../services/color_convert/color_convert.js'
import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
@@ -23,15 +24,15 @@ export default {
computed: {
classes () {
return [{
- 'user-card-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius
- 'user-card-rounded': this.rounded === true, // set border-radius for all sides
- 'user-card-bordered': this.bordered === true // set border for all sides
+ 'user-card-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius
+ 'user-card-rounded': this.rounded === true, // set border-radius for all sides
+ 'user-card-bordered': this.bordered === true // set border for all sides
}]
},
style () {
const color = this.$store.state.config.customTheme.colors
- ? this.$store.state.config.customTheme.colors.bg // v2
- : this.$store.state.config.colors.bg // v1
+ ? this.$store.state.config.customTheme.colors.bg // v2
+ : this.$store.state.config.colors.bg // v1
if (color) {
const rgb = (typeof color === 'string') ? hex2rgb(color) : color
@@ -73,12 +74,12 @@ export default {
userHighlightType: {
get () {
const data = this.$store.state.config.highlight[this.user.screen_name]
- return data && data.type || 'disabled'
+ return (data && data.type) || 'disabled'
},
set (type) {
const data = this.$store.state.config.highlight[this.user.screen_name]
if (type !== 'disabled') {
- this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: data && data.color || '#FFFFFF', type })
+ this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: (data && data.color) || '#FFFFFF', type })
} else {
this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: undefined })
}
@@ -104,13 +105,14 @@ export default {
components: {
UserAvatar,
RemoteFollow,
- ModerationTools
+ ModerationTools,
+ ProgressButton
},
methods: {
followUser () {
const store = this.$store
this.followRequestInProgress = true
- requestFollow(this.user, store).then(({sent}) => {
+ requestFollow(this.user, store).then(({ sent }) => {
this.followRequestInProgress = false
this.followRequestSent = sent
})
@@ -135,13 +137,19 @@ export default {
unmuteUser () {
this.$store.dispatch('unmuteUser', this.user.id)
},
+ subscribeUser () {
+ return this.$store.dispatch('subscribeUser', this.user.id)
+ },
+ unsubscribeUser () {
+ return this.$store.dispatch('unsubscribeUser', this.user.id)
+ },
setProfileView (v) {
if (this.switcher) {
const store = this.$store
store.commit('setProfileView', { v })
}
},
- linkClicked ({target}) {
+ linkClicked ({ target }) {
if (target.tagName === 'SPAN') {
target = target.parentNode
}