mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Fix location lookup.
This commit is contained in:
parent
7464bd2521
commit
ba71f5cafc
@ -71,8 +71,8 @@ export async function getLocation(ip) {
|
||||
|
||||
const result = lookup.get(ip);
|
||||
const country = result?.country?.iso_code ?? result?.registered_country?.iso_code;
|
||||
const subdivision1 = result?.subdivisions[0]?.iso_code;
|
||||
const subdivision2 = result?.subdivisions[1]?.names?.en;
|
||||
const subdivision1 = result?.subdivisions?.[0]?.iso_code;
|
||||
const subdivision2 = result?.subdivisions?.[1]?.names?.en;
|
||||
const city = result?.city?.names?.en;
|
||||
|
||||
return { country, subdivision1, subdivision2, city };
|
||||
|
Loading…
Reference in New Issue
Block a user