This commit is contained in:
Eric Bailey
2024-09-05 13:04:15 -05:00
parent 9ad2d11fa2
commit ae3f2015f2
2 changed files with 33 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import {emitGeoUpdated} from '#/state/events'
let geo: any
export async function resolveGeo() {
const req = new Promise(y => {
setTimeout(() => {
try {
geo = {country_code: 'US'}
emitGeoUpdated({geo})
} catch (e) {
} finally {
y(0)
}
}, 1000)
})
if (!geo) {
await req
}
}
export function getGeo() {
return geo
}