|
@@ -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
|