From 23220aea079b1cd18f13f659238c66370bf638c3 Mon Sep 17 00:00:00 2001 From: Paul Tiedtke Date: Sat, 20 Mar 2021 03:12:15 +0100 Subject: [PATCH] fix: titleConcat set to false is not removing pageTitle --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index d450fa0..46a576d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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, };