diff options
| author | Henry Jameson <me@hjkos.com> | 2022-08-23 15:36:54 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-08-23 15:36:54 +0300 |
| commit | bd7356376ec9137da674f146a89c17ed62f56bc3 (patch) | |
| tree | 382710cd8c308364c9915efbea014c37ba1b96bd /src/components/navigation/navigation_entry.js | |
| parent | 63f35509a79b8e9bc8bc301852847cf952a6a01f (diff) | |
fix links not being active by default
Diffstat (limited to 'src/components/navigation/navigation_entry.js')
| -rw-r--r-- | src/components/navigation/navigation_entry.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/navigation/navigation_entry.js b/src/components/navigation/navigation_entry.js index e17e9436..a19ee1b4 100644 --- a/src/components/navigation/navigation_entry.js +++ b/src/components/navigation/navigation_entry.js @@ -4,6 +4,15 @@ import { faThumbtack } from '@fortawesome/free-solid-svg-icons' library.add(faThumbtack) +const USERNAME_ROUTES = new Set([ + 'bookmarks', + 'dms', + 'interactions', + 'notifications', + 'chat', + 'chats' +]) + const NavigationEntry = { props: ['item', 'showPin'], methods: { @@ -20,6 +29,16 @@ const NavigationEntry = { } }, computed: { + routeTo () { + if (this.item.routeObject) { + return this.item.routeObject + } + const 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 } + } + return route + }, getters () { return this.$store.getters }, |
