diff --git a/index.html b/index.html index 3227adf1..66c39087 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,6 @@ font-size: 62.5%; } -
@@ -47,11 +46,13 @@ i(['call', c.call(arguments)]); }, init: function () { - var n = t.createElement('script'); - (n.async = !0), - (n.type = 'text/javascript'), - (n.src = 'https://cdn.livechatinc.com/tracking.js'), - t.head.appendChild(n); + setTimeout(() => { + var n = t.createElement('script'); + (n.async = !0), + (n.type = 'text/javascript'), + (n.src = 'https://cdn.livechatinc.com/tracking.js'), + t.head.appendChild(n); + }, 3000); }, }; !n.__lc.asyncInit && e.init(), (n.LiveChatWidget = n.LiveChatWidget || e); diff --git a/src/app/CoreStoreProvider.tsx b/src/app/CoreStoreProvider.tsx index c971b0f1..edfd28c3 100644 --- a/src/app/CoreStoreProvider.tsx +++ b/src/app/CoreStoreProvider.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useMemo, useRef } from 'react'; +import Cookies from 'js-cookie'; import { observer } from 'mobx-react-lite'; import { getDecimalPlaces, toMoment } from '@/components/shared'; import { FORM_ERROR_MESSAGES } from '@/components/shared/constants/form-error-messages'; @@ -21,7 +22,15 @@ const CoreStoreProvider: React.FC<{ children: React.ReactNode }> = observer(({ c const { currentLang } = useTranslations(); - const { oAuthLogout } = useOauth2({ handleLogout: async () => client.logout(), client }); + const { oAuthLogout, isOAuth2Enabled } = useOauth2({ handleLogout: async () => client.logout(), client }); + + const isLoggedOutCookie = Cookies.get('logged_state') === 'false'; + + useEffect(() => { + if (isLoggedOutCookie && isOAuth2Enabled && client?.is_logged_in) { + oAuthLogout(); + } + }, [isLoggedOutCookie, oAuthLogout, isOAuth2Enabled, client?.is_logged_in]); const activeAccount = useMemo( () => accountList?.find(account => account.loginid === activeLoginid), diff --git a/src/app/app-content.jsx b/src/app/app-content.jsx index 9e06dfc3..7ee6111e 100644 --- a/src/app/app-content.jsx +++ b/src/app/app-content.jsx @@ -112,13 +112,12 @@ const AppContent = observer(() => { }, [client.is_options_blocked, client.account_settings?.country_code, client.clients_country]); const init = () => { - // TODO: TBD - // import('@/utils/gtm').then(({ default: GTM }) => { - // GTM.init(); - // }); ServerTime.init(common); app.setDBotEngineStores(); ApiHelpers.setInstance(app.api_helpers_store); + import('@/utils/gtm').then(({ default: GTM }) => { + GTM.init(store); + }); }; const changeActiveSymbolLoadingState = () => { diff --git a/src/components/layout/header/header.tsx b/src/components/layout/header/header.tsx index 44d1b373..eb22cbb7 100644 --- a/src/components/layout/header/header.tsx +++ b/src/components/layout/header/header.tsx @@ -14,7 +14,6 @@ import { Tooltip } from '@deriv-com/ui'; import { AppLogo } from '../app-logo'; import AccountsInfoLoader from './account-info-loader'; import AccountSwitcher from './account-switcher'; -import CustomNotifications from './custom-notifications'; import MenuItems from './menu-items'; import MobileMenu from './mobile-menu'; import PlatformSwitcher from './platform-switcher'; @@ -39,7 +38,7 @@ const AppHeader = observer(() => { } else if (activeLoginid) { return ( <> -