logo

pleroma-fe

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

extra_notifications.js (1571B)


  1. import { mapGetters } from 'vuex'
  2. import { library } from '@fortawesome/fontawesome-svg-core'
  3. import {
  4. faUserPlus,
  5. faComments,
  6. faBullhorn
  7. } from '@fortawesome/free-solid-svg-icons'
  8. library.add(
  9. faUserPlus,
  10. faComments,
  11. faBullhorn
  12. )
  13. const ExtraNotifications = {
  14. computed: {
  15. shouldShowChats () {
  16. return this.mergedConfig.showExtraNotifications && this.mergedConfig.showChatsInExtraNotifications && this.unreadChatCount
  17. },
  18. shouldShowAnnouncements () {
  19. return this.mergedConfig.showExtraNotifications && this.mergedConfig.showAnnouncementsInExtraNotifications && this.unreadAnnouncementCount
  20. },
  21. shouldShowFollowRequests () {
  22. return this.mergedConfig.showExtraNotifications && this.mergedConfig.showFollowRequestsInExtraNotifications && this.followRequestCount
  23. },
  24. hasAnythingToShow () {
  25. return this.shouldShowChats || this.shouldShowAnnouncements || this.shouldShowFollowRequests
  26. },
  27. shouldShowCustomizationTip () {
  28. return this.mergedConfig.showExtraNotificationsTip && this.hasAnythingToShow
  29. },
  30. currentUser () {
  31. return this.$store.state.users.currentUser
  32. },
  33. ...mapGetters(['unreadChatCount', 'unreadAnnouncementCount', 'followRequestCount', 'mergedConfig'])
  34. },
  35. methods: {
  36. openNotificationSettings () {
  37. return this.$store.dispatch('openSettingsModalTab', 'notifications')
  38. },
  39. dismissConfigurationTip () {
  40. return this.$store.dispatch('setOption', { name: 'showExtraNotificationsTip', value: false })
  41. }
  42. }
  43. }
  44. export default ExtraNotifications