mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-30 13:41:50 +02:00
fix formatvalue for city showing undefined
This commit is contained in:
parent
cdc2624caf
commit
8f2fac10d1
|
@ -2,7 +2,7 @@ import useMessages from './useMessages';
|
|||
import { BROWSERS } from 'lib/constants';
|
||||
import useLocale from './useLocale';
|
||||
import useCountryNames from './useCountryNames';
|
||||
import regions from 'public/iso-3166-2.json';
|
||||
import regions from '../../../public/iso-3166-2.json';
|
||||
|
||||
export function useFormat() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
@ -23,7 +23,7 @@ export function useFormat() {
|
|||
};
|
||||
|
||||
const formatCity = (value: string, country?: string): string => {
|
||||
return `${value}, ${countryNames[country]}`;
|
||||
return countryNames[country] ? `${value}, ${countryNames[country]}` : value;
|
||||
};
|
||||
|
||||
const formatDevice = (value: string): string => {
|
||||
|
|
|
@ -4,7 +4,7 @@ import useLocale from 'components/hooks/useLocale';
|
|||
import useMessages from 'components/hooks/useMessages';
|
||||
import useCountryNames from 'components/hooks/useCountryNames';
|
||||
import MetricsTable, { MetricsTableProps } from './MetricsTable';
|
||||
import regions from 'public/iso-3166-2.json';
|
||||
import regions from '../../../public/iso-3166-2.json';
|
||||
|
||||
export function RegionsTable(props: MetricsTableProps) {
|
||||
const { locale } = useLocale();
|
||||
|
|
Loading…
Reference in New Issue
Block a user