Skip to content

Commit

Permalink
Merge pull request #2751 from gobitfly/NOBIDS/FixMainCurrencyPricesUn…
Browse files Browse the repository at this point in the history
…defined

(NOBIDS) Fix mainCurrencyPrices undefined error
  • Loading branch information
recy21 authored Dec 6, 2023
2 parents c6d0155 + 547b61d commit 72320cd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions static/js/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ function updateBanner() {
}

var ethPriceHandle = document.getElementById("banner-eth-price-data")

try {
let userCurrency = getCookie("currency")
if (userCurrency == data.rates.mainCurrency) userCurrency = data.rates.tickerCurrency
var price = data.rates.mainCurrencyPrices[userCurrency]
ethPriceHandle.innerHTML = `<span class='currency-symbol'>${price.symbol} </span><span class='k-formatted-price'>${price.truncPrice}</span><span class='price'>${addCommas(price.roundPrice)}</span>`
} catch (err) {
console.error("failed updating banner-price:", err)
if (ethPriceHandle) {
try {
let userCurrency = getCookie("currency")
if (!userCurrency || userCurrency == data.rates.mainCurrency) userCurrency = data.rates.tickerCurrency
var price = data.rates.mainCurrencyTickerPrices[userCurrency]
ethPriceHandle.innerHTML = `<span class='currency-symbol'>${price.symbol} </span><span class='k-formatted-price'>${price.truncPrice}</span><span class='price'>${addCommas(price.roundPrice)}</span>`
} catch (err) {
console.error("failed updating banner-price:", err)
}
}

var finDelayDataHandle = document.getElementById("banner-fin-data")
Expand Down

0 comments on commit 72320cd

Please sign in to comment.