Skip to content

Commit

Permalink
Merge pull request blockscout#5680 from blockscout/np-async-listing-l…
Browse files Browse the repository at this point in the history
…oad-changes

Fix broken token icons; Disable animation in lists of data in order t…
  • Loading branch information
vbaranov authored and jagdeep sidhu committed Jun 22, 2022
1 parent b7d27f1 commit 1c9408d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [#5667](https://github.com/blockscout/blockscout/pull/5667) - Address page: scroll to selected tab's data

### Fixes
- [#5680](https://github.com/blockscout/blockscout/pull/5680) - Fix broken token icons; Disable animation in lists; Fix doubled requests for some pages
- [#5671](https://github.com/blockscout/blockscout/pull/5671) - Fix double requests for token exchange rates; Disable fetching `btc_value` by default (add `EXCHANGE_RATES_FETCH_BTC_VALUE` env variable); Add `CACHE_EXCHANGE_RATES_PERIOD` env variable
- [#5676](https://github.com/blockscout/blockscout/pull/5676) - Fix wrong miner address shown for post EIP-1559 block for clique network

Expand Down
16 changes: 9 additions & 7 deletions apps/block_scout_web/assets/js/lib/async_listing_load.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,14 @@ function firstPageLoad (store) {

const $element = $('[data-async-load]')
if ($element.length) {
if (Object.prototype.hasOwnProperty.call($element.data(), 'noFirstLoading')) {
enableFirstLoading = false
}
if (enableFirstLoading) {
const store = createStore(asyncReducer)
connectElements({ store, elements })
firstPageLoad(store)
if (!Object.prototype.hasOwnProperty.call($element.data(), 'noSelfCalls')) {
if (Object.prototype.hasOwnProperty.call($element.data(), 'noFirstLoading')) {
enableFirstLoading = false
}
if (enableFirstLoading) {
const store = createStore(asyncReducer)
connectElements({ store, elements })
firstPageLoad(store)
}
}
}
4 changes: 2 additions & 2 deletions apps/block_scout_web/assets/js/lib/list_morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function (container, newElements, { key, horizontal } = {}) {
const overlap = intersectionBy(newList, currentList, 'id').map(({ id, el }) => ({ id, el: updateAllAges($(el))[0] }))
// remove old items
const removals = differenceBy(currentList, newList, 'id')
let canAnimate = !horizontal && newList.length > 0
let canAnimate = false && !horizontal && newList.length > 0 // disabled animation in order to speed up UI
removals.forEach(({ el }) => {
if (!canAnimate) return el.remove()
const $el = $(el)
Expand All @@ -59,7 +59,7 @@ export default function (container, newElements, { key, horizontal } = {}) {

// add new items
const finalList = newList.map(({ id, el }) => get(find(currentList, { id }), 'el', el)).reverse()
canAnimate = !horizontal
canAnimate = false && !horizontal // disabled animation in order to speed up UI
finalList.forEach((el, i) => {
if (el.parentElement) return
if (!canAnimate) return container.insertBefore(el, get(finalList, `[${i - 1}]`))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="card">
<%= render OverviewView, "_tabs.html", assigns %>
<!-- Token Holders -->
<div class="card-body" data-async-listing="<%= @current_path %>">
<div class="card-body" data-async-listing="<%= @current_path %>" data-no-self-calls>
<%= render BlockScoutWeb.CommonComponentsView, "_channel_disconnected_message.html", text: gettext("Connection Lost") %>
<h2 class="card-title list-title-description"><%= gettext "Token Holders" %></h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>
<%= render BlockScoutWeb.Advertisement.TextAdView, "index.html", conn: @conn %>
<div class="card">
<div class="card-body" data-async-load data-async-listing="<%= @current_path %>">
<div class="card-body" data-async-load data-async-listing="<%= @current_path %>" data-no-self-calls>
<h1 class="card-title list-title-description"><%= gettext "Tokens" %></h1>

<div class="list-top-pagination-container-wrapper tokens-list-search-input-outer-container d-flex" style="float: right;">
Expand Down

0 comments on commit 1c9408d

Please sign in to comment.