consistency, lint, cleanup
This commit is contained in:
parent
53a0ab9af2
commit
964e016bfb
12 changed files with 16 additions and 18 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { cloneDeep } from 'lodash'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
|
||||
import Gallery from 'src/components/gallery/gallery.vue'
|
||||
|
|
@ -6,7 +5,6 @@ import PostStatusForm from 'src/components/post_status_form/post_status_form.vue
|
|||
import StatusContent from 'src/components/status_content/status_content.vue'
|
||||
|
||||
import { useDraftsStore } from 'src/stores/drafts.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
import { useStatusesStore } from 'src/stores/statuses.js'
|
||||
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const ExtraNotifications = {
|
|||
return (
|
||||
this.mergedConfig.showExtraNotifications &&
|
||||
this.mergedConfig.showAnnouncementsInExtraNotifications &&
|
||||
this.unreadAnnouncementCount
|
||||
this.unreadAnnouncementsCount
|
||||
)
|
||||
},
|
||||
shouldShowFollowRequests() {
|
||||
|
|
@ -56,7 +56,7 @@ const ExtraNotifications = {
|
|||
return useUsersStore().currentUser
|
||||
},
|
||||
...mapState(useAnnouncementsStore, {
|
||||
unreadAnnouncementCount: 'unreadAnnouncementCount',
|
||||
unreadAnnouncementsCount: 'unreadAnnouncementsCount',
|
||||
}),
|
||||
...mapState(useMergedConfigStore, ['mergedConfig']),
|
||||
...mapState(useChatsStore, ['unreadChatsCount']),
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
class="fa-scale-110 icon"
|
||||
icon="bullhorn"
|
||||
/>
|
||||
{{ $t('notifications.unread_announcements', { num: unreadAnnouncementCount }, unreadAnnouncementCount) }}
|
||||
{{ $t('notifications.unread_announcements', { num: unreadAnnouncementsCount }, unreadAnnouncementsCount) }}
|
||||
</router-link>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ const MobileNav = {
|
|||
countExtraNotifications(
|
||||
useMergedConfigStore().mergedConfig,
|
||||
useChatsStore().unreadChatsCount,
|
||||
useAnnouncementsStore().unreadAnnouncementCount,
|
||||
useAnnouncementsStore().unreadAnnouncementsCount,
|
||||
useFollowRequestsStore().followRequestsCount,
|
||||
)
|
||||
)
|
||||
|
|
@ -96,7 +96,7 @@ const MobileNav = {
|
|||
closingDrawerMarksAsSeen() {
|
||||
return useMergedConfigStore().mergedConfig.closingDrawerMarksAsSeen
|
||||
},
|
||||
...mapState(useAnnouncementsStore, ['unreadAnnouncementCount']),
|
||||
...mapState(useAnnouncementsStore, ['unreadAnnouncementsCount']),
|
||||
...mapState(useMergedConfigStore, {
|
||||
pinnedItems: (store) =>
|
||||
new Set(store.prefsStorage.collections.pinnedNavItems).has('chats'),
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
icon="bars"
|
||||
/>
|
||||
<div
|
||||
v-if="(unreadChatsCount && !chatsPinned) || unreadAnnouncementCount"
|
||||
v-if="(unreadChatsCount && !chatsPinned) || unreadAnnouncementsCount"
|
||||
class="badge -dot -notification"
|
||||
/>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ const NavPanel = {
|
|||
},
|
||||
computed: {
|
||||
...mapState(useAnnouncementsStore, {
|
||||
unreadAnnouncementCount: 'unreadAnnouncementCount',
|
||||
unreadAnnouncementsCount: 'unreadAnnouncementsCount',
|
||||
supportsAnnouncements: (store) => store.supportsAnnouncements,
|
||||
}),
|
||||
...mapState(useInstanceCapabilitiesStore, [
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const NavigationEntry = {
|
|||
badges() {
|
||||
return {
|
||||
drafts: this.draftsCount,
|
||||
unreadAnnouncements: this.unreadAnnouncementCount,
|
||||
unreadAnnouncements: this.unreadAnnouncementsCount,
|
||||
followRequests: this.followRequestsCount,
|
||||
unreadChats: this.unreadChatsCount,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const NavPanel = {
|
|||
badges() {
|
||||
return {
|
||||
drafts: this.draftsCount,
|
||||
unreadAnnouncements: this.unreadAnnouncementCount,
|
||||
unreadAnnouncements: this.unreadAnnouncementsCount,
|
||||
followRequests: this.followRequestsCount,
|
||||
unreadChats: this.unreadChatsCount,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ const Notifications = {
|
|||
return countExtraNotifications(
|
||||
useMergedConfigStore().mergedConfig,
|
||||
useChatsStore().unreadChatsCount,
|
||||
useAnnouncementsStore().unreadAnnouncementCount,
|
||||
useAnnouncementsStore().unreadAnnouncementsCount,
|
||||
useFollowRequestsStore().followRequestsCount,
|
||||
)
|
||||
},
|
||||
|
|
@ -118,7 +118,7 @@ const Notifications = {
|
|||
return (
|
||||
this.unseenNotifications.length +
|
||||
this.unreadChatsCount +
|
||||
this.unreadAnnouncementCount
|
||||
this.unreadAnnouncementsCount
|
||||
)
|
||||
},
|
||||
loading() {
|
||||
|
|
@ -157,7 +157,7 @@ const Notifications = {
|
|||
showExtraNotifications() {
|
||||
return !this.noExtra
|
||||
},
|
||||
...mapState(useAnnouncementsStore, ['unreadAnnouncementCount']),
|
||||
...mapState(useAnnouncementsStore, ['unreadAnnouncementsCount']),
|
||||
...mapState(useChatsStore, ['unreadChatsCount']),
|
||||
...mapState(useInterfaceStore, ['layoutType']),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ const SideDrawer = {
|
|||
...mapState(useFollowRequestsStore, ['followRequestsCount']),
|
||||
...mapState(useAnnouncementsStore, [
|
||||
'supportsAnnouncements',
|
||||
'unreadAnnouncementCount',
|
||||
'unreadAnnouncementsCount',
|
||||
]),
|
||||
...mapState(useInstanceCapabilitiesStore, [
|
||||
'pleromaChatMessagesAvailable',
|
||||
|
|
|
|||
|
|
@ -248,10 +248,10 @@
|
|||
icon="bullhorn"
|
||||
/> {{ $t("nav.announcements") }}
|
||||
<span
|
||||
v-if="unreadAnnouncementCount"
|
||||
v-if="unreadAnnouncementsCount"
|
||||
class="badge -notification"
|
||||
>
|
||||
{{ unreadAnnouncementCount }}
|
||||
{{ unreadAnnouncementsCount }}
|
||||
</span>
|
||||
</router-link>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const useAnnouncementsStore = defineStore('announcements', {
|
|||
userActions: {},
|
||||
}),
|
||||
getters: {
|
||||
unreadAnnouncementCount() {
|
||||
unreadAnnouncementsCount() {
|
||||
if (!useUsersStore().currentUser) {
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue