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_view_settings.js (2176B)


  1. import Popover from '../popover/popover.vue'
  2. import { mapGetters } from 'vuex'
  3. import { library } from '@fortawesome/fontawesome-svg-core'
  4. import { faList, faFolderTree, faBars, faWrench } from '@fortawesome/free-solid-svg-icons'
  5. library.add(
  6. faList,
  7. faFolderTree,
  8. faBars,
  9. faWrench
  10. )
  11. const QuickViewSettings = {
  12. props: {
  13. conversation: Boolean
  14. },
  15. components: {
  16. Popover
  17. },
  18. methods: {
  19. setConversationDisplay (visibility) {
  20. this.$store.dispatch('setOption', { name: 'conversationDisplay', value: visibility })
  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. conversationDisplay: {
  32. get () { return this.mergedConfig.conversationDisplay },
  33. set (newVal) { this.setConversationDisplay(newVal) }
  34. },
  35. autoUpdate: {
  36. get () { return this.mergedConfig.streaming },
  37. set () {
  38. const value = !this.autoUpdate
  39. this.$store.dispatch('setOption', { name: 'streaming', value })
  40. }
  41. },
  42. collapseWithSubjects: {
  43. get () { return this.mergedConfig.collapseMessageWithSubject },
  44. set () {
  45. const value = !this.collapseWithSubjects
  46. this.$store.dispatch('setOption', { name: 'collapseMessageWithSubject', value })
  47. }
  48. },
  49. showUserAvatars: {
  50. get () { return this.mergedConfig.mentionLinkShowAvatar },
  51. set () {
  52. const value = !this.showUserAvatars
  53. this.$store.dispatch('setOption', { name: 'mentionLinkShowAvatar', value })
  54. }
  55. },
  56. muteBotStatuses: {
  57. get () { return this.mergedConfig.muteBotStatuses },
  58. set () {
  59. const value = !this.muteBotStatuses
  60. this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
  61. }
  62. },
  63. muteSensitiveStatuses: {
  64. get () { return this.mergedConfig.muteSensitiveStatuses },
  65. set () {
  66. const value = !this.muteSensitiveStatuses
  67. this.$store.dispatch('setOption', { name: 'muteSensitiveStatuses', value })
  68. }
  69. }
  70. }
  71. }
  72. export default QuickViewSettings