refactor: resolve currency exchange issue
This commit is contained in:
@@ -16,10 +16,7 @@ export const CurrencyProvider = ({ children }) => {
|
||||
useEffect(() => {
|
||||
const fetchCurrencyForCountry = async () => {
|
||||
try {
|
||||
const userCountry = localStorage.getItem('userCountry');
|
||||
if (!userCountry) {
|
||||
return;
|
||||
}
|
||||
let userCountry = localStorage.getItem('userCountry') || "India";
|
||||
|
||||
const response = await axios.get(`https://restcountries.com/v3.1/name/${userCountry}`);
|
||||
if (response.data && response.data.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user