Skip to content

Commit

Permalink
7315-customDomainCrash (#7316)
Browse files Browse the repository at this point in the history
* bug fix... maybe?

* Handle missed case in breadcrumb switch statement.

---------

Co-authored-by: Jake Naviasky <[email protected]>
  • Loading branch information
lzach83 and jnaviask committed Apr 2, 2024
1 parent 658e2f8 commit 2322f43
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const Breadcrumbs = () => {
chainId: app.activeChainId(),
ids: [getThreadId && Number(getThreadId[1])],
apiCallEnabled:
location.pathname.split('/')[1].toLowerCase() === 'discussion', //Only call when in discussion pages prevents unnecessary calls.
// Only call when in discussion pages prevents unnecessary calls.
location.pathname.split('/')[1].toLowerCase() === 'discussion',
});

const user = app?.user?.addresses?.[0];
Expand Down Expand Up @@ -55,6 +56,7 @@ export const Breadcrumbs = () => {
location.pathname,
profileId,
navigate,
app.isCustomDomain() ? app.activeChainId() : undefined,
currentDiscussion,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ export const generateBreadcrumbs = (
locationPath: string,
profileId: number,
navigate: (val: To) => void,
customDomain: string,
currentDiscussion?: currentDiscussion,
) => {
let link: string;
let label: string;
let isParent: boolean;

if (customDomain) {
locationPath = `${customDomain}${locationPath}`;
}

const pathSegments = locationPath
.split('/')
.filter((segment) => segment.length > 0);
Expand All @@ -67,12 +73,7 @@ export const generateBreadcrumbs = (
link = `profile/id/${profileId}`;
break;
case 'members':
if (
pathSegments[index] === 'members' &&
pathSegments[index + 1] === 'update'
) {
link = 'members';
}
link = 'members';
break;
case 'snapshot':
//Match the header on the snapshots page
Expand Down

0 comments on commit 2322f43

Please sign in to comment.