Skip to content

Commit

Permalink
Merge pull request #441 from kausaltech/fix/double-locale-in-logo-link
Browse files Browse the repository at this point in the history
Fix URL construction for LogoLink
  • Loading branch information
lilia1891 authored Dec 9, 2024
2 parents 3ffbd8f + bc2c6ce commit 4781412
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/common/GlobalNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import NavbarSearch from './NavbarSearch';

const getRootLink = (plan, locale, primaryLanguage) => {
if (plan.parent && plan.parent.viewUrl) {
const shouldAppendLocale = locale !== primaryLanguage;
const shouldAppendLocale =
locale !== primaryLanguage &&
!plan.parent.viewUrl.includes(`/${locale}/`);
if (shouldAppendLocale) {
return `${plan.parent.viewUrl}/${locale}/`;
}
Expand Down

0 comments on commit 4781412

Please sign in to comment.