FIX: Links are not displayed if the setting doesn't associate a locale (#31)

Related #30.
Reported here: https://meta.discourse.org/t/missing-custom-header-links-after-update/262594

#### Current behavior
The links are not displayed if a locale is not provided in the setting.

#### Expected behavior
By not associating a locale with a link, the link should be displayed by default regardless of the user's language.
This commit is contained in:
Arkshine 2023-04-24 16:09:35 +02:00 committed by GitHub
parent 0661c627cb
commit 6bc3216b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ export default {
.toLowerCase()
.replace(/\s/gi, "-")}-custom-header-links`;
const localeClass = locale === "" ? "" : `.${locale}`;
const localeClass = locale === undefined ? "" : `.${locale}`;
const anchorAttributes = {
title: linkTitle,
@ -55,7 +55,7 @@ export default {
}
if (
locale !== "" &&
locale !== undefined &&
document.documentElement.lang &&
document.documentElement.lang !== locale
) {