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(
|
const currentCountry = CountriesJSON.find(
|
||||||
(countryJson) => countryJson.alpha2 === country.iso.toLowerCase()
|
(countryJson) => countryJson.alpha2 === country.iso.toLowerCase()
|
||||||
);
|
);
|
||||||
setCountry({ ...country, label: currentCountry[language.toLowerCase()] });
|
// setCountry({ ...country, label: currentCountry[language.toLowerCase()] });
|
||||||
console.log("currentCountry", country);
|
if (currentCountry && currentCountry[language.toLowerCase()] !== country.label) {
|
||||||
|
setCountry({ ...country, label: currentCountry[language.toLowerCase()] });
|
||||||
// eslint-disable-next-line
|
}
|
||||||
}, [language]);
|
}, [language, country]);
|
||||||
|
|
||||||
function changeUserLanguage(newLanguage) {
|
function changeUserLanguage(newLanguage) {
|
||||||
setLanguage(newLanguage);
|
setLanguage(newLanguage);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user