logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

block_card.js (818B)


  1. import BasicUserCard from '../basic_user_card/basic_user_card.vue'
  2. const BlockCard = {
  3. props: ['userId'],
  4. data () {
  5. return {
  6. progress: false
  7. }
  8. },
  9. computed: {
  10. user () {
  11. return this.$store.getters.findUser(this.userId)
  12. },
  13. relationship () {
  14. return this.$store.getters.relationship(this.userId)
  15. },
  16. blocked () {
  17. return this.relationship.blocking
  18. }
  19. },
  20. components: {
  21. BasicUserCard
  22. },
  23. methods: {
  24. unblockUser () {
  25. this.progress = true
  26. this.$store.dispatch('unblockUser', this.user.id).then(() => {
  27. this.progress = false
  28. })
  29. },
  30. blockUser () {
  31. this.progress = true
  32. this.$store.dispatch('blockUser', this.user.id).then(() => {
  33. this.progress = false
  34. })
  35. }
  36. }
  37. }
  38. export default BlockCard