Skip to content

Commit 9afbcd7

Browse files
authored
Merge pull request #74 from epochtalk/profile-breadcrumbs
Profile Breadcrumbs
2 parents 3055ac8 + c451174 commit 9afbcd7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/composables/stores/breadcrumbs.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export default {
5151
let keyToType = {
5252
boardSlug: 'board',
5353
slug: 'thread',
54-
threadSlug: 'thread'
54+
threadSlug: 'thread',
55+
username: 'profile'
5556
}
5657
// remove anchor hash from params
5758
let routeParamKeys = without(Object.keys(routeParams), '#')
@@ -60,11 +61,13 @@ export default {
6061
// matches, route is dynamic
6162
if (!isEmpty(matches)) {
6263
let idKey = routeParamKeys.reverse()[0]
63-
let id = routeParams[idKey]
64+
// for proxy, use query parameter to get user id
65+
let id = idKey !== 'username' ? routeParams[idKey] : $route.query.id
6466
let type = keyToType[idKey]
6567
let crumbs = await breadcrumbsApi.find(id, type)
6668
breadcrumbs.splice(0, breadcrumbs.length)
67-
breadcrumbs.push(pathLookup.home)
69+
// for proxy, do not push 'Home' to breadcrumbs for profile page
70+
if (idKey !== 'username') breadcrumbs.push(pathLookup.home)
6871
breadcrumbs.push(...crumbs.breadcrumbs)
6972

7073
}

0 commit comments

Comments
 (0)