refactor: less noise in queryExchangeRates

This commit is contained in:
xenticore
2025-05-01 18:25:13 -04:00
parent b84b53c544
commit c053af1928

View File

@@ -3,13 +3,8 @@ chrome.runtime.onMessage.addListener(
if (request.contentScriptQuery == "queryExchangeRates") { if (request.contentScriptQuery == "queryExchangeRates") {
const url = "https://open.er-api.com/v6/latest/USD"; const url = "https://open.er-api.com/v6/latest/USD";
fetch(url) fetch(url)
.then(response => { .then(response => response.json())
console.log(response) .then(json => sendResponse(json))
return response.json()
})
.then(json => {
sendResponse(json)
})
.catch(error => { .catch(error => {
console.error("Failed to get exchange rates", error); console.error("Failed to get exchange rates", error);
}) })