refactor: resolve currency exchange issue

This commit is contained in:
2025-05-14 09:44:44 +05:30
parent a8f7a7bc14
commit 0444eb6a2c

View File

@@ -16,10 +16,7 @@ export const CurrencyProvider = ({ children }) => {
useEffect(() => { useEffect(() => {
const fetchCurrencyForCountry = async () => { const fetchCurrencyForCountry = async () => {
try { try {
const userCountry = localStorage.getItem('userCountry'); let userCountry = localStorage.getItem('userCountry') || "India";
if (!userCountry) {
return;
}
const response = await axios.get(`https://restcountries.com/v3.1/name/${userCountry}`); const response = await axios.get(`https://restcountries.com/v3.1/name/${userCountry}`);
if (response.data && response.data.length > 0) { if (response.data && response.data.length > 0) {