|
|
|
@ -79,10 +79,15 @@ function resolvePhoneCodeFromCountryCode(isoCode?: string): string | undefined { |
|
|
|
return undefined; |
|
|
|
} |
|
|
|
|
|
|
|
export function getUserGeoRegion(): Promise<UserGeoRegion> { |
|
|
|
const existing = getStoredUserGeoRegion(); |
|
|
|
if (existing && (existing.city || existing.country)) { |
|
|
|
return Promise.resolve(existing); |
|
|
|
export function getUserGeoRegion(force = false): Promise<UserGeoRegion> { |
|
|
|
if (!force) { |
|
|
|
const existing = getStoredUserGeoRegion(); |
|
|
|
if (existing && (existing.city || existing.country)) { |
|
|
|
return Promise.resolve(existing); |
|
|
|
} |
|
|
|
} else { |
|
|
|
cachedRegion = null; |
|
|
|
geoRegionPromise = null; |
|
|
|
} |
|
|
|
|
|
|
|
if (geoRegionPromise) { |
|
|
|
|