aboutsummaryrefslogtreecommitdiff
path: root/src/components/remove_follower_button/remove_follower_button.js
blob: e1a7531bfe0552ce76ef69740fa717af339d74be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export default {
  props: ['relationship'],
  data () {
    return {
      inProgress: false
    }
  },
  computed: {
    label () {
      if (this.inProgress) {
        return this.$t('user_card.follow_progress')
      } else {
        return this.$t('user_card.remove_follower')
      }
    }
  },
  methods: {
    onClick () {
      this.inProgress = true
      this.$store.dispatch('removeUserFromFollowers', this.relationship.id).then(() => {
        this.inProgress = false
      })
    }
  }
}