Skip to content

Commit

Permalink
test: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
maryia-deriv committed Jun 6, 2024
1 parent 03384f4 commit 8fe8685
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/javascript/app/base/binary_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ const BinaryLoader = (() => {
let active_script = null;

const init = () => {
const supported_langs_regex = Object.keys(getAll()).map(lang => lang.toLowerCase()).join('|');
const pathname = window.location.pathname;
const search = window.location.search;
const pattern = `/(?!${supported_langs_regex})\\w{2,5}/`;
// redirect to /en/ page if pathname contains an unsupported language:
if (new RegExp(`^${pattern}\\w+`).test(pathname)) {
const en_pathname = pathname.replace(new RegExp(pattern), '/en/');
const en_href = `${window.location.origin}${en_pathname}${search || ''}`;
window.history.replaceState({ url: en_href }, document.title, en_href);
}
// const supported_langs_regex = Object.keys(getAll()).map(lang => lang.toLowerCase()).join('|');
// const pathname = window.location.pathname;
// const search = window.location.search;
// const pattern = `/(?!${supported_langs_regex})\\w{2,5}/`;
// // redirect to /en/ page if pathname contains an unsupported language:
// if (new RegExp(`^${pattern}\\w+`).test(pathname)) {
// const en_pathname = pathname.replace(new RegExp(pattern), '/en/');
// const en_href = `${window.location.origin}${en_pathname}${search || ''}`;
// window.history.replaceState({ url: en_href }, document.title, en_href);
// }

if (!isStorageSupported(localStorage) || !isStorageSupported(sessionStorage)) {
Header.displayNotification({ key: 'storage_not_supported', title: 'Storage not supported', message: localize('Requires your browser\'s web storage to be enabled in order to function properly. Please enable it or exit private browsing mode.'), type: 'danger' });
Expand Down

0 comments on commit 8fe8685

Please sign in to comment.