fixing flags rerenders
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4186850c0d
commit
f4d7d4ad40
|
|
@ -39,11 +39,11 @@ export function UserContextProvider({ children }) {
|
|||
const currentCountry = CountriesJSON.find(
|
||||
(countryJson) => countryJson.alpha2 === country.iso.toLowerCase()
|
||||
);
|
||||
setCountry({ ...country, label: currentCountry[language.toLowerCase()] });
|
||||
console.log("currentCountry", country);
|
||||
|
||||
// eslint-disable-next-line
|
||||
}, [language]);
|
||||
// setCountry({ ...country, label: currentCountry[language.toLowerCase()] });
|
||||
if (currentCountry && currentCountry[language.toLowerCase()] !== country.label) {
|
||||
setCountry({ ...country, label: currentCountry[language.toLowerCase()] });
|
||||
}
|
||||
}, [language, country]);
|
||||
|
||||
function changeUserLanguage(newLanguage) {
|
||||
setLanguage(newLanguage);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user