From 64bd79f4fc3c8ce0f637ed496e391349e0970de4 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Thu, 24 Sep 2020 19:06:00 +0300 Subject: [PATCH] token balances display fix --- .../address_token_balance_controller.ex | 20 +++++++++++++------ .../transaction_internal_transaction_view.ex | 1 - 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex index 9a0e4809e9..548b92b20d 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/address_token_balance_controller.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) diff --git a/apps/block_scout_web/lib/block_scout_web/views/transaction_internal_transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/transaction_internal_transaction_view.ex index e2f83de578..74ff6042cc 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/transaction_internal_transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/transaction_internal_transaction_view.ex @@ -1,5 +1,4 @@ defmodule BlockScoutWeb.TransactionInternalTransactionView do use BlockScoutWeb, :view - @dialyzer :no_match end