fix: ripple effect of skip_registeration_form if country not coming from ip (#838)
Co-authored-by: Syed Sajjad Hussain Shah <syed.sajjad@H7FKF7K6XD.local>
This commit is contained in:
committed by
GitHub
parent
9d487d7b61
commit
c2bdc31a03
@@ -190,21 +190,24 @@ const RegistrationPage = (props) => {
|
||||
}, [registrationErrorCode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (backendCountryCode !== '') {
|
||||
const selectedCountry = countryList.find(
|
||||
(country) => (country[COUNTRY_CODE_KEY].toLowerCase() === backendCountryCode.toLowerCase()),
|
||||
);
|
||||
if (selectedCountry) {
|
||||
setConfigurableFormFields(prevState => (
|
||||
{
|
||||
...prevState,
|
||||
country: {
|
||||
countryCode: selectedCountry[COUNTRY_CODE_KEY], displayValue: selectedCountry[COUNTRY_DISPLAY_KEY],
|
||||
},
|
||||
}
|
||||
));
|
||||
}
|
||||
let countryCode = '';
|
||||
let countryDisplayValue = '';
|
||||
|
||||
const selectedCountry = countryList.find(
|
||||
(country) => (country[COUNTRY_CODE_KEY].toLowerCase() === backendCountryCode.toLowerCase()),
|
||||
);
|
||||
if (selectedCountry) {
|
||||
countryCode = selectedCountry[COUNTRY_CODE_KEY];
|
||||
countryDisplayValue = selectedCountry[COUNTRY_DISPLAY_KEY];
|
||||
}
|
||||
setConfigurableFormFields(prevState => (
|
||||
{
|
||||
...prevState,
|
||||
country: {
|
||||
countryCode, displayValue: countryDisplayValue,
|
||||
},
|
||||
}
|
||||
));
|
||||
}, [backendCountryCode, countryList]);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user