aboutsummaryrefslogtreecommitdiff
path: root/src/components/follow_button
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2020-05-25 03:29:48 +0300
committerHenry Jameson <me@hjkos.com>2020-05-25 03:29:48 +0300
commit138ec85003b41079e31fe618c5953b286a2b3c1e (patch)
treeee09fdac26ba0aa5b135370ce8660781c09e2e99 /src/components/follow_button
parent1e606d2f268e796a3efd2a995713c70a000daf62 (diff)
parent1ae8935977b2e974b6727b6a02035c9d38c9d670 (diff)
Merge remote-tracking branch 'origin/develop' into settings-modal
* origin/develop: (95 commits) Translated using Weblate (Italian) Translated using Weblate (Chinese (Simplified)) Translated using Weblate (Russian) Translated using Weblate (Polish) Translated using Weblate (Dutch) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) Translated using Weblate (German) ...
Diffstat (limited to 'src/components/follow_button')
-rw-r--r--src/components/follow_button/follow_button.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js
index 12da2645..95e7cb6b 100644
--- a/src/components/follow_button/follow_button.js
+++ b/src/components/follow_button/follow_button.js
@@ -1,6 +1,6 @@
import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
export default {
- props: ['user', 'labelFollowing', 'buttonClass'],
+ props: ['relationship', 'labelFollowing', 'buttonClass'],
data () {
return {
inProgress: false
@@ -8,12 +8,12 @@ export default {
},
computed: {
isPressed () {
- return this.inProgress || this.user.following
+ return this.inProgress || this.relationship.following
},
title () {
- if (this.inProgress || this.user.following) {
+ if (this.inProgress || this.relationship.following) {
return this.$t('user_card.follow_unfollow')
- } else if (this.user.requested) {
+ } else if (this.relationship.requested) {
return this.$t('user_card.follow_again')
} else {
return this.$t('user_card.follow')
@@ -22,9 +22,9 @@ export default {
label () {
if (this.inProgress) {
return this.$t('user_card.follow_progress')
- } else if (this.user.following) {
+ } else if (this.relationship.following) {
return this.labelFollowing || this.$t('user_card.following')
- } else if (this.user.requested) {
+ } else if (this.relationship.requested) {
return this.$t('user_card.follow_sent')
} else {
return this.$t('user_card.follow')
@@ -33,20 +33,20 @@ export default {
},
methods: {
onClick () {
- this.user.following ? this.unfollow() : this.follow()
+ this.relationship.following ? this.unfollow() : this.follow()
},
follow () {
this.inProgress = true
- requestFollow(this.user, this.$store).then(() => {
+ requestFollow(this.relationship.id, this.$store).then(() => {
this.inProgress = false
})
},
unfollow () {
const store = this.$store
this.inProgress = true
- requestUnfollow(this.user, store).then(() => {
+ requestUnfollow(this.relationship.id, store).then(() => {
this.inProgress = false
- store.commit('removeStatus', { timeline: 'friends', userId: this.user.id })
+ store.commit('removeStatus', { timeline: 'friends', userId: this.relationship.id })
})
}
}