diff --git a/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js b/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js index d6dc074529..edac1726dd 100644 --- a/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js +++ b/apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js @@ -20,10 +20,10 @@ export function createCoinBalanceHistoryChart (el) { var stepSize = 3 - if (data.length > 2) { + if (data.length > 1) { var diff = Math.abs(new Date(data[0].date) - new Date(data[1].date)) var periodInDays = diff / (1000 * 60 * 60 * 24) - console.log(periodInDays) + stepSize = periodInDays } return new Chart(el, { diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index bc85fef406..97ebd77d69 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -2965,7 +2965,6 @@ defmodule Explorer.Chain do |> CoinBalance.fetch_coin_balances(paging_options) |> page_coin_balances(paging_options) |> Repo.all() - |> Enum.dedup() end def get_coin_balance(address_hash, block_number) do @@ -2998,7 +2997,7 @@ defmodule Explorer.Chain do today = Date.to_string(NaiveDateTime.utc_now()) if Enum.count(result) > 0 && !Enum.any?(result, fn map -> map[:date] == today end) do - [%{date: today, value: List.last(result)[:value]} | result] + result ++ [%{date: today, value: List.last(result)[:value]}] else result end