From fa832f41d67320eaa26f9bdc3062eb95f809f5b2 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 12 Oct 2020 16:33:14 +0300 Subject: [PATCH] Fix logs search --- CHANGELOG.md | 1 + apps/block_scout_web/assets/js/pages/address/logs.js | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3000d0a45..0de7bcefa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Fixes +- [#3344](https://github.com/poanetwork/blockscout/pull/3344) - Fix logs search on address page - [#3342](https://github.com/poanetwork/blockscout/pull/3342) - Fix mobile styles for contract code tab - [#3341](https://github.com/poanetwork/blockscout/pull/3341) - Change Solc binary downloader path to official primary supported path - [#3339](https://github.com/poanetwork/blockscout/pull/3339) - Repair websocket subscription diff --git a/apps/block_scout_web/assets/js/pages/address/logs.js b/apps/block_scout_web/assets/js/pages/address/logs.js index 885fc16007..41faace88e 100644 --- a/apps/block_scout_web/assets/js/pages/address/logs.js +++ b/apps/block_scout_web/assets/js/pages/address/logs.js @@ -67,13 +67,15 @@ if ($('[data-page="address-logs"]').length) { addressHash: addressHash }) - $element.on('click', '[data-search-button]', (event) => { + $element.on('click', '[data-search-button]', (_event) => { store.dispatch({ type: 'START_SEARCH', addressHash: addressHash }) - var topic = $('[data-search-field]').val() - var path = '/search_logs?topic=' + topic + '&address_id=' + store.getState().addressHash + const topic = $('[data-search-field]').val() + const addressHashPlain = store.getState().addressHash + const addressHashChecksum = addressHashPlain && window.web3.toChecksumAddress(addressHashPlain) + const path = '/search-logs?topic=' + topic + '&address_id=' + addressHashChecksum store.dispatch({ type: 'START_REQUEST' }) $.getJSON(path, { type: 'JSON' }) .done(response => store.dispatch(Object.assign({ type: 'ITEMS_FETCHED' }, humps.camelizeKeys(response)))) @@ -81,7 +83,7 @@ if ($('[data-page="address-logs"]').length) { .always(() => store.dispatch({ type: 'FINISH_REQUEST' })) }) - $element.on('click', '[data-cancel-search-button]', (event) => { + $element.on('click', '[data-cancel-search-button]', (_event) => { window.location.replace(window.location.href.split('?')[0]) }) }