Refactor breadcrumbs to use factory-based route renderers
This commit is contained in:
@@ -21,8 +21,16 @@ export const resolveSearchResultsHref = ({
|
||||
const routeState = normalizeRouteStateQuery(query);
|
||||
const { viewAll, advanced, address, key } = routeState;
|
||||
const base = hasSession ? "/myportal" : "";
|
||||
const hasSearchQuery =
|
||||
typeof query?.q === "string" && query.q.trim().length > 0;
|
||||
|
||||
if (fallbackToMyPortalWhenNoFlags && !viewAll && !advanced && !address) {
|
||||
if (hasSearchQuery) {
|
||||
return {
|
||||
pathname: `${base}/searchresults`,
|
||||
query
|
||||
};
|
||||
}
|
||||
return {
|
||||
pathname: "/myportal"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user