Merge pull request #5483 from mempool/natsoni/handle-city-states

Handle city-states in geolocation component
This commit is contained in:
softsimon 2024-10-10 16:22:48 +09:00 committed by GitHub
commit fe4b39df80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,6 +70,12 @@ export class GeolocationComponent implements OnChanges {
if (this.type === 'node') { if (this.type === 'node') {
const city = this.data.city ? this.data.city : ''; const city = this.data.city ? this.data.city : '';
// Handle city-states like Singapore or Hong Kong
if (city && city === this.data?.country) {
this.formattedLocation = `${this.data.country} ${getFlagEmoji(this.data.iso)}`;
return;
}
// City // City
this.formattedLocation = `${city}`; this.formattedLocation = `${city}`;