You've already forked tf2wikipricing
refactor: less noise in queryExchangeRates
This commit is contained in:
@@ -3,13 +3,8 @@ chrome.runtime.onMessage.addListener(
|
||||
if (request.contentScriptQuery == "queryExchangeRates") {
|
||||
const url = "https://open.er-api.com/v6/latest/USD";
|
||||
fetch(url)
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
return response.json()
|
||||
})
|
||||
.then(json => {
|
||||
sendResponse(json)
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(json => sendResponse(json))
|
||||
.catch(error => {
|
||||
console.error("Failed to get exchange rates", error);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user