Skip to content

Commit

Permalink
fix: titleConcat set to false is not removing pageTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
sapkra committed Mar 20, 2021
1 parent 971a508 commit 23220ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ const getTitle = (
): TitleObject => {
const { route, currentMatch } = getRoute(routesConfig, path);

if (route) {
if (route && route.titleConcat !== false) {
if (route.title) { titles.push(route.title); }

if (route.routes && route.titleConcat !== false) {
if (route.routes) {
return getTitle(route.routes, path, divider, titles, currentMatch || matchCache);
}
}

return {
title: titles.reverse().join(` ${divider} `),
title: route.titleConcat !== false ? titles.reverse().join(` ${divider} `) : route.title,
titles,
params: currentMatch ? currentMatch.params : matchCache.params,
};
Expand Down

0 comments on commit 23220ae

Please sign in to comment.