Bug fixing

This commit is contained in:
John Lyon-Smith
2018-04-23 14:01:52 -07:00
parent 5cb13f7498
commit 9730c83c9c
26 changed files with 121 additions and 147 deletions

View File

@@ -390,14 +390,18 @@ class API extends EventEmitter {
method: "GET",
mode: "no-cors",
}
let headers = new Headers()
fetch(
headers.set("Referer", config.refererURL)
fetchOptions.headers = headers
const path =
config.googleGeocodeURL +
`?latlng=${coord.latitude},${coord.longitude}&key=${
config.googleAPIKey
}`,
fetchOptions
)
`?latlng=${coord.latitude},${coord.longitude}&key=${
config.googleGeocodeAPIKey
}`
fetch(path, fetchOptions)
.then((res) => {
return Promise.all([Promise.resolve(res), res.json()])
})
@@ -407,7 +411,7 @@ class API extends EventEmitter {
if (res.ok) {
let address = ""
if (responseBody.results && responseBody.result.length > 0) {
if (responseBody.results && responseBody.results.length > 0) {
address = responseBody.results[0].formatted_address
}