logo

pleroma-fe

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

quick_filter_settings.js (2910B)


  1. import Popover from '../popover/popover.vue'
  2. import { mapGetters } from 'vuex'
  3. import { mapState } from 'pinia'
  4. import { library } from '@fortawesome/fontawesome-svg-core'
  5. import { faFilter, faFont, faWrench } from '@fortawesome/free-solid-svg-icons'
  6. import { useInterfaceStore } from 'src/stores/interface'
  7. library.add(
  8. faFilter,
  9. faFont,
  10. faWrench
  11. )
  12. const QuickFilterSettings = {
  13. props: {
  14. conversation: Boolean,
  15. nested: Boolean
  16. },
  17. components: {
  18. Popover
  19. },
  20. methods: {
  21. setReplyVisibility (visibility) {
  22. this.$store.dispatch('setOption', { name: 'replyVisibility', value: visibility })
  23. this.$store.dispatch('queueFlushAll')
  24. },
  25. openTab (tab) {
  26. useInterfaceStore().openSettingsModalTab(tab)
  27. }
  28. },
  29. computed: {
  30. ...mapGetters(['mergedConfig']),
  31. ...mapState(useInterfaceStore, {
  32. mobileLayout: state => state.layoutType === 'mobile'
  33. }),
  34. triggerAttrs () {
  35. if (this.mobileLayout) {
  36. return {}
  37. } else {
  38. return {
  39. title: this.$t('timeline.quick_filter_settings')
  40. }
  41. }
  42. },
  43. mainClass () {
  44. if (this.mobileLayout) {
  45. return 'main-button'
  46. } else {
  47. return 'dropdown-item'
  48. }
  49. },
  50. loggedIn () {
  51. return !!this.$store.state.users.currentUser
  52. },
  53. replyVisibilitySelf: {
  54. get () { return this.mergedConfig.replyVisibility === 'self' },
  55. set () { this.setReplyVisibility('self') }
  56. },
  57. replyVisibilityFollowing: {
  58. get () { return this.mergedConfig.replyVisibility === 'following' },
  59. set () { this.setReplyVisibility('following') }
  60. },
  61. replyVisibilityAll: {
  62. get () { return this.mergedConfig.replyVisibility === 'all' },
  63. set () { this.setReplyVisibility('all') }
  64. },
  65. hideMedia: {
  66. get () { return this.mergedConfig.hideAttachments || this.mergedConfig.hideAttachmentsInConv },
  67. set () {
  68. const value = !this.hideMedia
  69. this.$store.dispatch('setOption', { name: 'hideAttachments', value })
  70. this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value })
  71. }
  72. },
  73. hideMutedPosts: {
  74. get () { return this.mergedConfig.hideFilteredStatuses },
  75. set () {
  76. const value = !this.hideMutedPosts
  77. this.$store.dispatch('setOption', { name: 'hideFilteredStatuses', value })
  78. }
  79. },
  80. muteBotStatuses: {
  81. get () { return this.mergedConfig.muteBotStatuses },
  82. set () {
  83. const value = !this.muteBotStatuses
  84. this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
  85. }
  86. },
  87. muteSensitiveStatuses: {
  88. get () { return this.mergedConfig.muteSensitiveStatuses },
  89. set () {
  90. const value = !this.muteSensitiveStatuses
  91. this.$store.dispatch('setOption', { name: 'muteSensitiveStatuses', value })
  92. }
  93. }
  94. }
  95. }
  96. export default QuickFilterSettings