Skip to content

Commit 54061d2

Browse files
authored
fix naming inconsistency between activity and mapbox data (#981)
* fix naming inconsistency between activity and mapbox data * format check
1 parent 75c25c2 commit 54061d2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/hooks/useActivities.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ import activities from '@/static/activities.json';
44

55
// standardize country names for consistency between mapbox and activities data
66
const standardizeCountryName = (country: string): string => {
7-
switch (country) {
8-
case '英国 / 英國':
9-
return '英国';
10-
case '美利坚合众国/美利堅合眾國':
11-
return '美国';
12-
default:
13-
return country;
7+
if (country.includes('美利坚合众国')) {
8+
return '美国';
9+
}
10+
if (country.includes('英国')) {
11+
return '英国';
12+
}
13+
if (country.includes('印度尼西亚')) {
14+
return '印度尼西亚';
15+
} else {
16+
return country;
1417
}
1518
};
1619

0 commit comments

Comments
 (0)