summaryrefslogtreecommitdiff
path: root/src/Actions/entity.ts
diff options
context:
space:
mode:
authorAlexander NeonXP Kiryukhin <a.kiryukhin@mail.ru>2019-06-11 02:51:30 +0300
committerAlexander NeonXP Kiryukhin <a.kiryukhin@mail.ru>2019-06-11 02:51:30 +0300
commitf12a3bccd8c726e59e92123a3d8ef1f5a73d7253 (patch)
treed4b6e126c0f216972562621608a4ba97800a94bf /src/Actions/entity.ts
parentb7810c3d6c0164def328c60244bfbd20d7935bc3 (diff)
Fixes
Diffstat (limited to 'src/Actions/entity.ts')
-rw-r--r--src/Actions/entity.ts16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/Actions/entity.ts b/src/Actions/entity.ts
index 8b01ea6..2b85ffe 100644
--- a/src/Actions/entity.ts
+++ b/src/Actions/entity.ts
@@ -15,7 +15,7 @@ const entity = {
...queue,
] : []
const tiles = getTilesToLoad(region, width).filter(t => loadedAlready.indexOf(t) == -1)
- dispatch(entity.setLoadQueue([...queue, ...tiles]))
+ dispatch(entity.setLoadQueue(tiles))
setImmediate(() => dispatch(entity.loadRutine()))
},
@@ -52,21 +52,11 @@ const entity = {
const portal = decodePortal(j.result)
portal.fullLoad = true
dispatch(entity.portalSet(guid, portal))
- let addr = "нет"
- try {
- addr = await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&polygon_geojson=1&lat=${portal.coords.latitude}&lon=${portal.coords.longitude}`)
- .then(r => r.json())
- .then(j => [j.address.city, j.address.road, j.address.house_number].filter(p => !!p).join(', ') || 'нет')
- } catch (e) {
- addr = "ошибка"
- }
- portal.address = addr
- dispatch(entity.portalSet(guid, portal))
})
},
- 'setLoadQueue': (queue: string[][]) => ({
+ 'setLoadQueue': (queue: string[]) => ({
type: 'setLoad',
- queue
+ queue,
}),
'portalsSet': (portals: { [guid: string]: Portal }) => ({
type: 'portalsSet',