Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit ab32ee4

Browse files
authored
Fix IP cookie issue loop for login (#4204)
* chore: fix ip cookie issue * chore: fix ip cookie issue * chore: made country readonly
1 parent 101f7ea commit ab32ee4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/components/layout/layout.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { CookieStorage } from 'common/storage'
2222
import { usePageLoaded } from 'components/hooks/use-page-loaded'
2323
import useDerivWS from 'components/hooks/use-deriv-ws'
2424
import usePopup from 'components/hooks/use-popup'
25+
import useWebsiteStatus from 'components/hooks/use-website-status'
2526

2627
const LoadableFooter = Loadable(() => import('./footer'))
2728
const BeSquareFooter = Loadable(() => import('./besquare/footer'))
@@ -72,6 +73,7 @@ const Layout = ({
7273
const [is_redirection_applied, setRedirectionApplied] = useState(false)
7374
const { send } = useDerivWS()
7475
const { has_platform } = usePlatformQueryParam()
76+
const { website_status, setWebsiteStatus } = useWebsiteStatus()
7577

7678
const is_static = type === 'static'
7779

@@ -85,6 +87,14 @@ const Layout = ({
8587

8688
const current_client_country = clients_country || ''
8789
const client_information_cookie = new CookieStorage('client_information')
90+
91+
const new_website_status = {
92+
...website_status,
93+
clients_country: current_client_country,
94+
}
95+
96+
setWebsiteStatus(new_website_status)
97+
8898
const residence = client_information_cookie.get('residence')
8999
setRedirectionApplied(true)
90100
isEuDomain() && handleRowRedirect(residence, current_client_country)

src/pages/endpoint/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ const Endpoint = () => {
211211
placeholder={'e.g. 9999'}
212212
/>
213213
<StyledInput
214+
readOnly
214215
name="clients_country"
215216
error={errors.clients_country}
216217
value={values.clients_country}

0 commit comments

Comments
 (0)