diff options
| author | Henry Jameson <me@hjkos.com> | 2023-06-05 21:53:14 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2023-06-05 21:53:14 +0300 |
| commit | 5e656cc0b40a26435556fff79636c0b2e9c8af4f (patch) | |
| tree | 8efc5369ac64d471b4d61f731bd99653f7e1e19d /src/components/navigation/navigation_pins.js | |
| parent | 00b47e16736f8b472f20dab8def30fb22d54c8be (diff) | |
| parent | ae5181d21eefecc0167e2a076e6c8ad44f3ca859 (diff) | |
Merge remote-tracking branch 'origin/develop' into harden-parser
Diffstat (limited to 'src/components/navigation/navigation_pins.js')
| -rw-r--r-- | src/components/navigation/navigation_pins.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/components/navigation/navigation_pins.js b/src/components/navigation/navigation_pins.js index 9dd795aa..86c33d1f 100644 --- a/src/components/navigation/navigation_pins.js +++ b/src/components/navigation/navigation_pins.js @@ -1,5 +1,5 @@ import { mapState } from 'vuex' -import { TIMELINES, ROOT_ITEMS, USERNAME_ROUTES } from 'src/components/navigation/navigation.js' +import { TIMELINES, ROOT_ITEMS, routeTo } from 'src/components/navigation/navigation.js' import { getListEntries, filterNavigation } from 'src/components/navigation/filter.js' import { library } from '@fortawesome/fontawesome-svg-core' @@ -31,14 +31,7 @@ const NavPanel = { props: ['limit'], methods: { getRouteTo (item) { - if (item.routeObject) { - return item.routeObject - } - const route = { name: (item.anon || this.currentUser) ? item.route : item.anonRoute } - if (USERNAME_ROUTES.has(route.name)) { - route.params = { username: this.currentUser.screen_name } - } - return route + return routeTo(item, this.currentUser) } }, computed: { @@ -52,6 +45,7 @@ const NavPanel = { privateMode: state => state.instance.private, federating: state => state.instance.federating, pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable, + supportsAnnouncements: state => state.announcements.supportsAnnouncements, pinnedItems: state => new Set(state.serverSideStorage.prefsStorage.collections.pinnedNavItems) }), pinnedList () { @@ -63,6 +57,7 @@ const NavPanel = { ], { hasChats: this.pleromaChatMessagesAvailable, + hasAnnouncements: this.supportsAnnouncements, isFederating: this.federating, isPrivate: this.privateMode, currentUser: this.currentUser @@ -82,6 +77,7 @@ const NavPanel = { ], { hasChats: this.pleromaChatMessagesAvailable, + hasAnnouncements: this.supportsAnnouncements, isFederating: this.federating, isPrivate: this.privateMode, currentUser: this.currentUser |
