Skip to content

Commit

Permalink
Don't use Object.hasOwn
Browse files Browse the repository at this point in the history
It crashed for a user using Firefox 91
It wasn't needed
  • Loading branch information
starsep committed Feb 13, 2024
1 parent 60620b9 commit 6d0be85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/downloadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export default function DownloadCard() {
function countryName(country: Country) {
if (country.code === worldCountryCode) return t("sidebar.world");
const backendLanguageUppercase = language.toUpperCase();
if (Object.hasOwn(country.names, backendLanguageUppercase)) {
if (country.names[backendLanguageUppercase] !== undefined) {
return country.names[backendLanguageUppercase];
}
if (backendLanguageUppercase.includes("-")) {
const basicLanguage = backendLanguageUppercase.split("-")[0];
if (Object.hasOwn(country.names, basicLanguage)) {
if (country.names[basicLanguage] !== undefined) {
return country.names[basicLanguage];
}
}
Expand Down

0 comments on commit 6d0be85

Please sign in to comment.