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 { routeTo } from 'src/components/navigation/navigation.js'
|
||||||
import OptionalRouterLink from 'src/components/optional_router_link/optional_router_link.vue'
|
import OptionalRouterLink from 'src/components/optional_router_link/optional_router_link.vue'
|
||||||
|
|
@ -51,7 +51,7 @@ const NavigationEntry = {
|
||||||
unreadChats: this.unreadChatsCount,
|
unreadChats: this.unreadChatsCount,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
...mapStores(useAnnouncementsStore),
|
...mapState(useAnnouncementsStore, ['unreadAnnouncementsCount']),
|
||||||
...mapState(useDraftsStore, ['draftsCount']),
|
...mapState(useDraftsStore, ['draftsCount']),
|
||||||
...mapState(useUsersStore, ['currentUser']),
|
...mapState(useUsersStore, ['currentUser']),
|
||||||
...mapState(useChatsStore, ['unreadChatsCount']),
|
...mapState(useChatsStore, ['unreadChatsCount']),
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
{{ badges[item.badgeGetter] }}
|
{{ badges[item.badgeGetter] }}
|
||||||
</div>
|
</div>
|
||||||
<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"
|
class="badge badge-notification"
|
||||||
>
|
>
|
||||||
{{ this[`${item.store}Store`][item.badgeGetter] }}
|
{{ this[`${item.store}Store`][item.badgeGetter] }}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ import {
|
||||||
|
|
||||||
import { useAnnouncementsStore } from 'src/stores/announcements'
|
import { useAnnouncementsStore } from 'src/stores/announcements'
|
||||||
import { useBookmarkFoldersStore } from 'src/stores/bookmark_folders'
|
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 { useFollowRequestsStore } from 'src/stores/follow_requests.js'
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
|
|
@ -69,10 +71,14 @@ const NavPanel = {
|
||||||
}),
|
}),
|
||||||
...mapState(useAnnouncementsStore, {
|
...mapState(useAnnouncementsStore, {
|
||||||
supportsAnnouncements: (store) => store.supportsAnnouncements,
|
supportsAnnouncements: (store) => store.supportsAnnouncements,
|
||||||
|
unreadAnnouncementsCount: 'unreadAnnouncementsCount',
|
||||||
}),
|
}),
|
||||||
|
...mapState(useDraftsStore, ['draftsCount']),
|
||||||
|
...mapState(useFollowRequestsStore, ['followRequestsCount']),
|
||||||
...mapState(useBookmarkFoldersStore, {
|
...mapState(useBookmarkFoldersStore, {
|
||||||
bookmarks: getBookmarkFolderEntries,
|
bookmarks: getBookmarkFolderEntries,
|
||||||
}),
|
}),
|
||||||
|
...mapState(useChatsStore, ['unreadChatsCount']),
|
||||||
...mapState(useSyncConfigStore, {
|
...mapState(useSyncConfigStore, {
|
||||||
pinnedItems: (store) =>
|
pinnedItems: (store) =>
|
||||||
new Set(store.prefsStorage.collections.pinnedNavItems),
|
new Set(store.prefsStorage.collections.pinnedNavItems),
|
||||||
|
|
@ -83,7 +89,6 @@ const NavPanel = {
|
||||||
'localBubble',
|
'localBubble',
|
||||||
]),
|
]),
|
||||||
...mapState(useUsersStore, ['currentUser']),
|
...mapState(useUsersStore, ['currentUser']),
|
||||||
...mapState(useFollowRequestsStore, ['followRequestsCount']),
|
|
||||||
pinnedList() {
|
pinnedList() {
|
||||||
if (!this.currentUser) {
|
if (!this.currentUser) {
|
||||||
return filterNavigation(
|
return filterNavigation(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue