From 62dc04a75b6986221f7524fea46560f3ddec16e7 Mon Sep 17 00:00:00 2001 From: jimmay5469 Date: Fri, 22 Jun 2018 15:13:11 -0400 Subject: [PATCH] Handle reload for address's first transaction Co-authored-by: Stamates --- apps/explorer_web/assets/js/pages/address.js | 7 +++++++ .../templates/address_transaction/index.html.eex | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/explorer_web/assets/js/pages/address.js b/apps/explorer_web/assets/js/pages/address.js index e1e78f9c55..d0bde59501 100644 --- a/apps/explorer_web/assets/js/pages/address.js +++ b/apps/explorer_web/assets/js/pages/address.js @@ -7,6 +7,13 @@ if (window.page === 'address') { .receive('ok', resp => { console.log('Joined successfully', `addresses:${window.addressHash}`, resp) }) .receive('error', resp => { console.log('Unable to join', `addresses:${window.addressHash}`, resp) }) + const $emptyTransactionsList = $('[data-selector="empty-transactions-list"]') + if ($emptyTransactionsList) { + channel.on('transaction', () => { + window.location.reload() + }) + } + const $transactionsList = $('[data-selector="transactions-list"]') if ($transactionsList) { channel.on('transaction', (msg) => { diff --git a/apps/explorer_web/lib/explorer_web/templates/address_transaction/index.html.eex b/apps/explorer_web/lib/explorer_web/templates/address_transaction/index.html.eex index c284d42855..23d6c21671 100644 --- a/apps/explorer_web/lib/explorer_web/templates/address_transaction/index.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/address_transaction/index.html.eex @@ -100,7 +100,7 @@ <% else %> -

<%= gettext "There are no Transactions" %>

+

<%= gettext "There are no Transactions" %>

<% end %>