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 (2415B)


  1. import Popover from 'src/components/popover/popover.vue'
  2. import QuickFilterSettings from 'src/components/quick_filter_settings/quick_filter_settings.vue'
  3. import { mapGetters, mapState } from 'vuex'
  4. import { library } from '@fortawesome/fontawesome-svg-core'
  5. import { faList, faFolderTree, faBars, faWrench } from '@fortawesome/free-solid-svg-icons'
  6. library.add(
  7. faList,
  8. faFolderTree,
  9. faBars,
  10. faWrench
  11. )
  12. const QuickViewSettings = {
  13. props: {
  14. conversation: Boolean
  15. },
  16. components: {
  17. Popover,
  18. QuickFilterSettings
  19. },
  20. methods: {
  21. setConversationDisplay (visibility) {
  22. this.$store.dispatch('setOption', { name: 'conversationDisplay', value: visibility })
  23. },
  24. openTab (tab) {
  25. this.$store.dispatch('openSettingsModalTab', tab)
  26. }
  27. },
  28. computed: {
  29. ...mapGetters(['mergedConfig']),
  30. ...mapState({
  31. mobileLayout: state => state.interface.layoutType === 'mobile'
  32. }),
  33. loggedIn () {
  34. return !!this.$store.state.users.currentUser
  35. },
  36. conversationDisplay: {
  37. get () { return this.mergedConfig.conversationDisplay },
  38. set (newVal) { this.setConversationDisplay(newVal) }
  39. },
  40. autoUpdate: {
  41. get () { return this.mergedConfig.streaming },
  42. set () {
  43. const value = !this.autoUpdate
  44. this.$store.dispatch('setOption', { name: 'streaming', value })
  45. }
  46. },
  47. collapseWithSubjects: {
  48. get () { return this.mergedConfig.collapseMessageWithSubject },
  49. set () {
  50. const value = !this.collapseWithSubjects
  51. this.$store.dispatch('setOption', { name: 'collapseMessageWithSubject', value })
  52. }
  53. },
  54. showUserAvatars: {
  55. get () { return this.mergedConfig.mentionLinkShowAvatar },
  56. set () {
  57. const value = !this.showUserAvatars
  58. this.$store.dispatch('setOption', { name: 'mentionLinkShowAvatar', value })
  59. }
  60. },
  61. muteBotStatuses: {
  62. get () { return this.mergedConfig.muteBotStatuses },
  63. set () {
  64. const value = !this.muteBotStatuses
  65. this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
  66. }
  67. },
  68. muteSensitiveStatuses: {
  69. get () { return this.mergedConfig.muteSensitiveStatuses },
  70. set () {
  71. const value = !this.muteSensitiveStatuses
  72. this.$store.dispatch('setOption', { name: 'muteSensitiveStatuses', value })
  73. }
  74. }
  75. }
  76. }
  77. export default QuickViewSettings