mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fix location lookup.
This commit is contained in:
parent
7464bd2521
commit
ba71f5cafc
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue