fix navigation badges
This commit is contained in:
parent
964e016bfb
commit
fd701a468f
3 changed files with 9 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { mapState, mapStores } from 'pinia'
|
||||
import { mapState } from 'pinia'
|
||||
|
||||
import { routeTo } from 'src/components/navigation/navigation.js'
|
||||
import OptionalRouterLink from 'src/components/optional_router_link/optional_router_link.vue'
|
||||
|
|
@ -51,7 +51,7 @@ const NavigationEntry = {
|
|||
unreadChats: this.unreadChatsCount,
|
||||
}
|
||||
},
|
||||
...mapStores(useAnnouncementsStore),
|
||||
...mapState(useAnnouncementsStore, ['unreadAnnouncementsCount']),
|
||||
...mapState(useDraftsStore, ['draftsCount']),
|
||||
...mapState(useUsersStore, ['currentUser']),
|
||||
...mapState(useChatsStore, ['unreadChatsCount']),
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
{{ badges[item.badgeGetter] }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="item.badgeGetter && item.store && this[`${item.store}Store`][item.badgeGetter]"
|
||||
v-else-if="item.badgeGetter && item.store && badges[item.badgeGetter]"
|
||||
class="badge badge-notification"
|
||||
>
|
||||
{{ this[`${item.store}Store`][item.badgeGetter] }}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import {
|
|||
|
||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
|
||||
import { useChatsStore } from 'src/stores/chats.js'
|
||||
import { useDraftsStore } from 'src/stores/drafts.js'
|
||||
import { useFollowRequestsStore } from 'src/stores/follow_requests.js'
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
|
|
@ -69,10 +71,14 @@ const NavPanel = {
|
|||
}),
|
||||
...mapState(useAnnouncementsStore, {
|
||||
supportsAnnouncements: (store) => store.supportsAnnouncements,
|
||||
unreadAnnouncementsCount: 'unreadAnnouncementsCount',
|
||||
}),
|
||||
...mapState(useDraftsStore, ['draftsCount']),
|
||||
...mapState(useFollowRequestsStore, ['followRequestsCount']),
|
||||
...mapState(useBookmarkFoldersStore, {
|
||||
bookmarks: getBookmarkFolderEntries,
|
||||
}),
|
||||
...mapState(useChatsStore, ['unreadChatsCount']),
|
||||
...mapState(useSyncConfigStore, {
|
||||
pinnedItems: (store) =>
|
||||
new Set(store.prefsStorage.collections.pinnedNavItems),
|
||||
|
|
@ -83,7 +89,6 @@ const NavPanel = {
|
|||
'localBubble',
|
||||
]),
|
||||
...mapState(useUsersStore, ['currentUser']),
|
||||
...mapState(useFollowRequestsStore, ['followRequestsCount']),
|
||||
pinnedList() {
|
||||
if (!this.currentUser) {
|
||||
return filterNavigation(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue