token balances display fix

pull/3311/head^2
Victor Baranov 4 years ago
parent 35a6edd6de
commit 54ce4a9e3b
  1. 20
      apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex
  2. 1
      apps/block_scout_web/lib/block_scout_web/views/transaction_internal_transaction_view.ex

@ -6,17 +6,25 @@ defmodule BlockScoutWeb.AddressTokenBalanceController do
def index(conn, %{"address_id" => address_hash_string} = params) do
with true <- ajax?(conn),
{:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string),
{:ok, false} <- AccessHelpers.restricted_access?(address_hash_string, params) do
{:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string) do
token_balances =
address_hash
|> Chain.fetch_last_token_balances()
|> Market.add_price()
conn
|> put_status(200)
|> put_layout(false)
|> render("_token_balances.html", token_balances: token_balances)
case AccessHelpers.restricted_access?(address_hash_string, params) do
{:ok, false} ->
conn
|> put_status(200)
|> put_layout(false)
|> render("_token_balances.html", token_balances: token_balances)
_ ->
conn
|> put_status(200)
|> put_layout(false)
|> render("_token_balances.html", token_balances: [])
end
else
_ ->
not_found(conn)

@ -1,5 +1,4 @@
defmodule BlockScoutWeb.TransactionInternalTransactionView do
use BlockScoutWeb, :view
@dialyzer :no_match
end

Loading…
Cancel
Save