logo

pleroma-fe

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

quick_filter_settings.js (2114B)


  1. import Popover from '../popover/popover.vue'
  2. import { mapGetters } from 'vuex'
  3. import { library } from '@fortawesome/fontawesome-svg-core'
  4. import { faFilter, faFont, faWrench } from '@fortawesome/free-solid-svg-icons'
  5. library.add(
  6. faFilter,
  7. faFont,
  8. faWrench
  9. )
  10. const QuickFilterSettings = {
  11. props: {
  12. conversation: Boolean
  13. },
  14. components: {
  15. Popover
  16. },
  17. methods: {
  18. setReplyVisibility (visibility) {
  19. this.$store.dispatch('setOption', { name: 'replyVisibility', value: visibility })
  20. this.$store.dispatch('queueFlushAll')
  21. },
  22. openTab (tab) {
  23. this.$store.dispatch('openSettingsModalTab', tab)
  24. }
  25. },
  26. computed: {
  27. ...mapGetters(['mergedConfig']),
  28. loggedIn () {
  29. return !!this.$store.state.users.currentUser
  30. },
  31. replyVisibilitySelf: {
  32. get () { return this.mergedConfig.replyVisibility === 'self' },
  33. set () { this.setReplyVisibility('self') }
  34. },
  35. replyVisibilityFollowing: {
  36. get () { return this.mergedConfig.replyVisibility === 'following' },
  37. set () { this.setReplyVisibility('following') }
  38. },
  39. replyVisibilityAll: {
  40. get () { return this.mergedConfig.replyVisibility === 'all' },
  41. set () { this.setReplyVisibility('all') }
  42. },
  43. hideMedia: {
  44. get () { return this.mergedConfig.hideAttachments || this.mergedConfig.hideAttachmentsInConv },
  45. set () {
  46. const value = !this.hideMedia
  47. this.$store.dispatch('setOption', { name: 'hideAttachments', value })
  48. this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value })
  49. }
  50. },
  51. hideMutedPosts: {
  52. get () { return this.mergedConfig.hideFilteredStatuses },
  53. set () {
  54. const value = !this.hideMutedPosts
  55. this.$store.dispatch('setOption', { name: 'hideFilteredStatuses', value })
  56. }
  57. },
  58. muteBotStatuses: {
  59. get () { return this.mergedConfig.muteBotStatuses },
  60. set () {
  61. const value = !this.muteBotStatuses
  62. this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
  63. }
  64. }
  65. }
  66. }
  67. export default QuickFilterSettings