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