Skip to content

Commit

Permalink
Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
jason5ng32 committed Oct 14, 2024
1 parent a7436b8 commit 5864d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion frontend/components/WebRtcTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ const fetchCountryCode = async (ip) => {
if (ipData) {
let country_code = ipData.country_code.toLowerCase();
let country = getCountryName(ipData.country_code, lang.value);
let country = ipData.country_code || 'N/A';
if (country !== 'N/A') {
country = getCountryName(ipData.country_code, lang.value);
}
return [country_code, country];
}
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/utils/transform-ip-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function transformDataFromIPapi(data, ipGeoSource, t, bingMapLanguage) {

const baseData = {
country_name: data.country_name || "",
country_code: data.country || "",
country_code: data.country === 'N/A' ? '' : data.country,
region: data.region || "",
city: data.city || "",
latitude: data.latitude || "",
Expand Down

0 comments on commit 5864d34

Please sign in to comment.