logo

pleroma-fe

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

timeline_quick_settings.js (2076B)


  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 TimelineQuickSettings = {
  11. components: {
  12. Popover
  13. },
  14. methods: {
  15. setReplyVisibility (visibility) {
  16. this.$store.dispatch('setOption', { name: 'replyVisibility', value: visibility })
  17. this.$store.dispatch('queueFlushAll')
  18. },
  19. openTab (tab) {
  20. this.$store.dispatch('openSettingsModalTab', tab)
  21. }
  22. },
  23. computed: {
  24. ...mapGetters(['mergedConfig']),
  25. loggedIn () {
  26. return !!this.$store.state.users.currentUser
  27. },
  28. replyVisibilitySelf: {
  29. get () { return this.mergedConfig.replyVisibility === 'self' },
  30. set () { this.setReplyVisibility('self') }
  31. },
  32. replyVisibilityFollowing: {
  33. get () { return this.mergedConfig.replyVisibility === 'following' },
  34. set () { this.setReplyVisibility('following') }
  35. },
  36. replyVisibilityAll: {
  37. get () { return this.mergedConfig.replyVisibility === 'all' },
  38. set () { this.setReplyVisibility('all') }
  39. },
  40. hideMedia: {
  41. get () { return this.mergedConfig.hideAttachments || this.mergedConfig.hideAttachmentsInConv },
  42. set () {
  43. const value = !this.hideMedia
  44. this.$store.dispatch('setOption', { name: 'hideAttachments', value })
  45. this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value })
  46. }
  47. },
  48. hideMutedPosts: {
  49. get () { return this.mergedConfig.hideFilteredStatuses },
  50. set () {
  51. const value = !this.hideMutedPosts
  52. this.$store.dispatch('setOption', { name: 'hideFilteredStatuses', value })
  53. }
  54. },
  55. muteBotStatuses: {
  56. get () { return this.mergedConfig.muteBotStatuses },
  57. set () {
  58. const value = !this.muteBotStatuses
  59. this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
  60. }
  61. }
  62. }
  63. }
  64. export default TimelineQuickSettings