Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
feat: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yashim-deriv committed Jun 24, 2024
1 parent 381b0c5 commit 664c9ae
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 88 deletions.
22 changes: 10 additions & 12 deletions themes/gatsby-theme-deriv/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const onClientEntry = async () => {
utm_medium: utm_data?.['utm_medium'],
utm_campaign: utm_data?.['utm_campaign'],
is_authorised: !!Cookies?.get('client_information'),
url: window.location.href
url: window.location.href,
})
//datadog
const dd_options = {
Expand Down Expand Up @@ -155,28 +155,26 @@ export const onRouteUpdate = ({ location }) => {

checkDomain()

Analytics?.getInstances()?.ab?.GrowthBook?.setURL(window.location.href)

const dataLayer = window.dataLayer
const domain = getDomain()
const client_information = getClientInformation(domain)
const is_logged_in = !!client_information

const path = location.pathname;
const path = location.pathname

if (path === '/mn') {
navigate('/', { replace: true });
navigate('/', { replace: true })
} else if (path.startsWith('/mn/')) {
const newPath = path.replace(/^\/mn/, '');
navigate(newPath || '/', { replace: true });
const newPath = path.replace(/^\/mn/, '')
navigate(newPath || '/', { replace: true })
}

if (path === '/km') {
navigate('/', { replace: true });
} else if (path.startsWith('/km/')) {
const newPath = path.replace(/^\/km/, '');
navigate(newPath || '/', { replace: true });
}
navigate('/', { replace: true })
} else if (path.startsWith('/km/')) {
const newPath = path.replace(/^\/km/, '')
navigate(newPath || '/', { replace: true })
}

// wrap inside a timeout to ensure the title has properly been changed
setTimeout(() => {
Expand Down
Loading

0 comments on commit 664c9ae

Please sign in to comment.