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


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