Adds fallback for countries missing in DataMap (#533)

pull/547/head
Vignesh Joglekar 6 years ago committed by GitHub
parent 2f29beea7d
commit bbb6bae4a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -131,7 +131,7 @@ class Filters extends React.Component {
}
if (key === "country") {
const allCountries = Datamap.prototype.worldTopo.objects.world.geometries;
const selectedCountry = allCountries.find((c) => c.id === value)
const selectedCountry = allCountries.find((c) => c.id === value) || {properties: {name: value}};
return <span className="inline-block max-w-2xs md:max-w-xs truncate">Country: <b>{selectedCountry.properties.name}</b></span>
}
if (key === "page") {

Loading…
Cancel
Save