diff options
Diffstat (limited to 'src/components/block_card/block_card.js')
| -rw-r--r-- | src/components/block_card/block_card.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/components/block_card/block_card.js b/src/components/block_card/block_card.js index 8788fb62..11fa27b4 100644 --- a/src/components/block_card/block_card.js +++ b/src/components/block_card/block_card.js @@ -1,11 +1,18 @@ import BasicUserCard from '../basic_user_card/basic_user_card.vue' const BlockCard = { - props: ['user'], + props: ['userId'], data () { return { - progress: false, - updated: false + progress: false + } + }, + computed: { + user () { + return this.$store.getters.userById(this.userId) + }, + blocked () { + return this.user.statusnet_blocking } }, components: { @@ -14,6 +21,15 @@ const BlockCard = { methods: { unblockUser () { this.progress = true + this.$store.dispatch('unblockUser', this.user.id).then(() => { + this.progress = false + }) + }, + blockUser () { + this.progress = true + this.$store.dispatch('blockUser', this.user.id).then(() => { + this.progress = false + }) } } } |
