From 9d68766abb57e4cf410240dbd762d5b95fb2b08f Mon Sep 17 00:00:00 2001 From: mitra-deriv <64970259+mitra-deriv@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:25:37 +0800 Subject: [PATCH] fix: :label: fix trackjs issue (#5826) * fix: :label: fix trackjs issue * empty: :rocket: to redeploy and trigger build --- src/features/components/atoms/link/internal.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/features/components/atoms/link/internal.tsx b/src/features/components/atoms/link/internal.tsx index 4e2eed6e224..2d8f10a9898 100644 --- a/src/features/components/atoms/link/internal.tsx +++ b/src/features/components/atoms/link/internal.tsx @@ -72,7 +72,10 @@ const Internal = ({ if (isBrowser()) { rawLocale = localStorage.getItem('i18n') ?? 'en' } - const locale = rawLocale?.replaceAll('-', '_') + let locale = 'en' + if (typeof rawLocale === 'string') { + locale = rawLocale?.replace(/-/g, '_') + } const { is_default, path } = language_config[locale] const is_non_localized = url.to.includes('careers')