commit: ec320e8fb6fbab4271e43b66d61b90dc07b3fc0b
parent 768b3ea14fa8f69192b39642701babcb94f80156
Author: Henry Jameson <me@hjkos.com>
Date: Tue, 30 Aug 2022 00:53:20 +0300
add a favorites "timeline" shortcut
Diffstat:
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/components/navigation/navigation.js b/src/components/navigation/navigation.js
@@ -4,7 +4,8 @@ export const USERNAME_ROUTES = new Set([
'interactions',
'notifications',
'chat',
- 'chats'
+ 'chats',
+ 'user-profile'
])
export const TIMELINES = {
@@ -33,6 +34,11 @@ export const TIMELINES = {
icon: 'bookmark',
label: 'nav.bookmarks'
},
+ favorites: {
+ routeObject: { name: 'user-profile', query: { tab: 'favorites' } },
+ icon: 'star',
+ label: 'user_card.favorites'
+ },
dms: {
route: 'dms',
icon: 'envelope',
diff --git a/src/components/navigation/navigation_entry.js b/src/components/navigation/navigation_entry.js
@@ -23,12 +23,14 @@ const NavigationEntry = {
computed: {
routeTo () {
if (!this.item.route && !this.item.routeObject) return null
+ let route
if (this.item.routeObject) {
- return this.item.routeObject
+ route = this.item.routeObject
+ } else {
+ route = { name: (this.item.anon || this.currentUser) ? this.item.route : this.item.anonRoute }
}
- 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 }
+ route.params = { username: this.currentUser.screen_name, name: this.currentUser.screen_name }
}
return route
},