Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix unknown country display on realtime page.

Mike Cao50bc2371b84d
diff --git a/components/metrics/RealtimeLog.js b/components/metrics/RealtimeLog.js
index b5e7a65b5..6f23e4c89 100644
--- a/components/metrics/RealtimeLog.js
+++ b/components/metrics/RealtimeLog.js
@@ -129,7 +129,12 @@ export default function RealtimeLog({ data, websites, websiteId }) {
id="message.log.visitor"
defaultMessage="Visitor from {country} using {browser} on {os} {device}"
values={{
- country: <b>{countryNames[country]}</b>,
+ country: (
+ <b>
+ {countryNames[country] ||
+ intl.formatMessage({ id: 'label.unknown', defaultMessage: 'Unknown' })}
+ </b>
+ ),
browser: <b>{BROWSERS[browser]}</b>,
os: <b>{os}</b>,
device: <b>{intl.formatMessage(devices[device])?.toLowerCase()}</b>,