Skip to content

Commit

Permalink
fix selector in subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara committed Oct 21, 2024
1 parent 525913b commit 4ff5df1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (isBrowser()) {
});
}
} catch (error) {
console.log("GLOBALSEO:", error);
// console.log("GLOBALSEO:", error);
}
}

Expand Down
2 changes: 1 addition & 1 deletion utils/selector/createLanguageSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function addOrReplaceLangParam(window, url, lang) {
let subdomain = lang;

// get the domain without the subdomain
let rawDomain = window.isWorker ? hostname.split('.').slice(1).join('.') : hostname;
let rawDomain = (window.isWorker || window.activeSubdomain) ? hostname.split('.').slice(1).join('.') : hostname;
const isContainsWWW = rawDomain.startsWith('www.');
const domain = isContainsWWW ? rawDomain.substring(4) : rawDomain;
let newHostname = options.originalLanguage == lang ? domain : `${subdomain}.${domain}`;
Expand Down

0 comments on commit 4ff5df1

Please sign in to comment.