|
|
|
@ -193,11 +193,13 @@ defmodule BlockScoutWeb.AddressChannel do |
|
|
|
|
) do |
|
|
|
|
coin_balance = Chain.get_coin_balance(socket.assigns.address_hash, block_number) |
|
|
|
|
|
|
|
|
|
rendered_coin_balance = AddressViewAPI.render("coin_balance.json", %{coin_balance: coin_balance}) |
|
|
|
|
if coin_balance.value && coin_balance.delta do |
|
|
|
|
rendered_coin_balance = AddressViewAPI.render("coin_balance.json", %{coin_balance: coin_balance}) |
|
|
|
|
|
|
|
|
|
push(socket, "coin_balance", %{coin_balance: rendered_coin_balance}) |
|
|
|
|
push(socket, "coin_balance", %{coin_balance: rendered_coin_balance}) |
|
|
|
|
|
|
|
|
|
push_current_coin_balance(socket, block_number, coin_balance) |
|
|
|
|
push_current_coin_balance(socket, block_number, coin_balance) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
{:noreply, socket} |
|
|
|
|
end |
|
|
|
@ -207,19 +209,21 @@ defmodule BlockScoutWeb.AddressChannel do |
|
|
|
|
|
|
|
|
|
Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale) |
|
|
|
|
|
|
|
|
|
rendered_coin_balance = |
|
|
|
|
View.render_to_string( |
|
|
|
|
AddressCoinBalanceView, |
|
|
|
|
"_coin_balances.html", |
|
|
|
|
conn: socket, |
|
|
|
|
coin_balance: coin_balance |
|
|
|
|
) |
|
|
|
|
if coin_balance.value && coin_balance.delta do |
|
|
|
|
rendered_coin_balance = |
|
|
|
|
View.render_to_string( |
|
|
|
|
AddressCoinBalanceView, |
|
|
|
|
"_coin_balances.html", |
|
|
|
|
conn: socket, |
|
|
|
|
coin_balance: coin_balance |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
push(socket, "coin_balance", %{ |
|
|
|
|
coin_balance_html: rendered_coin_balance |
|
|
|
|
}) |
|
|
|
|
push(socket, "coin_balance", %{ |
|
|
|
|
coin_balance_html: rendered_coin_balance |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
push_current_coin_balance(socket, block_number, coin_balance) |
|
|
|
|
push_current_coin_balance(socket, block_number, coin_balance) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
{:noreply, socket} |
|
|
|
|
end |
|
|
|
|