Bug fixing
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user