logo

pleroma-fe

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

extra_notifications.js (1824B)


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