diff options
| author | Alexander Tumin <iamtakingiteasy@eientei.org> | 2023-03-17 22:24:22 +0300 |
|---|---|---|
| committer | Alexander Tumin <iamtakingiteasy@eientei.org> | 2023-03-17 23:31:53 +0300 |
| commit | 306e254c15c7cb7a19b680a5666695f429445729 (patch) | |
| tree | 196ef38e454bc03baa2b4b894558cb4add3ae308 /src/components/navigation/navigation_entry.js | |
| parent | 8abaf8fa375d8453b2284fbf529cd03ff565bcd4 (diff) | |
Fix user-profile route crash on pinned favorites route
Diffstat (limited to 'src/components/navigation/navigation_entry.js')
| -rw-r--r-- | src/components/navigation/navigation_entry.js | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/components/navigation/navigation_entry.js b/src/components/navigation/navigation_entry.js index 81cc936a..22ed77d9 100644 --- a/src/components/navigation/navigation_entry.js +++ b/src/components/navigation/navigation_entry.js @@ -1,5 +1,5 @@ import { mapState } from 'vuex' -import { USERNAME_ROUTES } 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 { library } from '@fortawesome/fontawesome-svg-core' import { faThumbtack } from '@fortawesome/free-solid-svg-icons' @@ -26,17 +26,7 @@ const NavigationEntry = { }, computed: { routeTo () { - if (!this.item.route && !this.item.routeObject) return null - let route - if (this.item.routeObject) { - route = this.item.routeObject - } else { - route = { name: (this.item.anon || this.currentUser) ? this.item.route : this.item.anonRoute } - } - if (USERNAME_ROUTES.has(route.name)) { - route.params = { username: this.currentUser.screen_name, name: this.currentUser.screen_name } - } - return route + return routeTo(this.item, this.currentUser) }, getters () { return this.$store.getters |
