Fix autocomplete links to txs, blocks, addresses

pull/4481/head
Viktor Baranov 3 years ago
parent f6a65ca3ad
commit 9c378cb1d6
  1. 2
      CHANGELOG.md
  2. 10
      apps/block_scout_web/assets/js/lib/autocomplete.js

@ -4,7 +4,7 @@
- [#4475](https://github.com/blockscout/blockscout/pull/4475) - Tx page facelifting
### Fixes
- [#4473](https://github.com/blockscout/blockscout/pull/4473) - Search autocomplete: fix for address/block/tx hash
- [#4473](https://github.com/blockscout/blockscout/pull/4473), [#4481](https://github.com/blockscout/blockscout/pull/4481) - Search autocomplete: fix for address/block/tx hash
- [#4472](https://github.com/blockscout/blockscout/pull/4472) - Search autocomplete: fix Cannot read property toLowerCase of undefined
- [#4456](https://github.com/blockscout/blockscout/pull/4456) - URL encoding for NFT media files URLs
- [#4453](https://github.com/blockscout/blockscout/pull/4453) - Unescape characters for string output type in the contract response

@ -135,7 +135,15 @@ const selection = (event) => {
if (selectionValue.symbol) {
window.location = `/tokens/${selectionValue.contract_address_hash}`
} else {
window.location = `/address/${selectionValue.contract_address_hash}`
if (selectionValue.contract_address_hash) {
window.location = `/address/${selectionValue.contract_address_hash}`
} else if (selectionValue.address_hash) {
window.location = `/address/${selectionValue.address_hash}`
} else if (selectionValue.transaction_hash) {
window.location = `/tx/${selectionValue.transaction_hash}`
} else if (selectionValue.block_hash) {
window.location = `/blocks/${selectionValue.block_hash}`
}
}
}

Loading…
Cancel
Save