fix: Broken header in public Help Center portal (#11704)

Fixes https://linear.app/chatwoot/issue/CW-4473/broken-header-in-help-center-portal
This commit is contained in:
Sivin Varghese
2025-06-12 00:37:24 +05:30
committed by GitHub
parent f627dbe42d
commit bf3b1676dd
11 changed files with 256 additions and 120 deletions

View File

@@ -59,17 +59,13 @@ export const openExternalLinksInNewTab = () => {
export const InitializationHelpers = {
navigateToLocalePage: () => {
const allLocaleSwitcher = document.querySelector('.locale-switcher');
document.addEventListener('change', e => {
const localeSwitcher = e.target.closest('.locale-switcher');
if (!localeSwitcher) return;
if (!allLocaleSwitcher) {
return false;
}
const { portalSlug } = allLocaleSwitcher.dataset;
allLocaleSwitcher.addEventListener('change', event => {
window.location = `/hc/${portalSlug}/${event.target.value}/`;
const { portalSlug } = localeSwitcher.dataset;
window.location.href = `/hc/${encodeURIComponent(portalSlug)}/${encodeURIComponent(localeSwitcher.value)}/`;
});
return false;
},
initializeSearch: () => {