Skip to content

Commit

Permalink
Correct nationality of Colapinto (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcokreeft87 authored Sep 16, 2024
1 parent 9306560 commit d58d334
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion formulaone-card.js

Large diffs are not rendered by default.

Binary file modified formulaone-card.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formulaone-card",
"version": "1.9.3",
"version": "1.9.4",
"description": "Frontend card for Home Assistant to display Formula One data",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export const getCountries = () => {

export const getCountryFlagByNationality = (card: BaseCard, nationality: string) => {
const countries = getCountries();

nationality = nationality.trim();
const exceptions = [{ demonym: 'Argentinian', corrected: 'Argentinean'}];
const exception = exceptions.filter(exception => exception.demonym == nationality);
if(exception.length > 0)
{
nationality = exception[0].corrected;
}

const country = countries.filter(x => x.demonym == nationality);
if(country.length > 1)
Expand Down

0 comments on commit d58d334

Please sign in to comment.