Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(api): restore commas in geoip location labels (#2812)

Hampus4ef9c4c65b48
diff --git a/fluxer_api/pkgs/geoip/src/GeoipLookup.ts b/fluxer_api/pkgs/geoip/src/GeoipLookup.ts
index 9ec4ddafb..223bcfe1a 100644
--- a/fluxer_api/pkgs/geoip/src/GeoipLookup.ts
+++ b/fluxer_api/pkgs/geoip/src/GeoipLookup.ts
@@ -285,6 +285,5 @@ export function formatGeoipLocation(result: GeoipResult, locale?: string | null)
const localizedCountry = locale && result.countryCode ? countryDisplayName(result.countryCode, locale) : null;
const countryLabel = localizedCountry ?? result.countryName ?? result.countryCode;
if (countryLabel) parts.push(countryLabel);
- if (parts.length === 0) return null;
- return new Intl.ListFormat(locale ?? 'en', {style: 'narrow', type: 'unit'}).format(parts);
+ return parts.length > 0 ? parts.join(', ') : null;
}